Blame SOURCES/evolution-data-server-3.40.4-icalcompiter.patch

2b63f4
diff --git a/src/calendar/backends/file/e-cal-backend-file.c b/src/calendar/backends/file/e-cal-backend-file.c
2b63f4
index f40bf807c..79ae53632 100644
2b63f4
--- a/src/calendar/backends/file/e-cal-backend-file.c
2b63f4
+++ b/src/calendar/backends/file/e-cal-backend-file.c
2b63f4
@@ -904,6 +904,7 @@ scan_vcalendar (ECalBackendFile *cbfile)
2b63f4
 			if (e_cal_component_set_icalcomponent (comp, icomp)) {
2b63f4
 				/* Thus it's not freed while being used in the 'comp' */
2b63f4
 				g_object_ref (icomp);
2b63f4
+				i_cal_object_set_owner (I_CAL_OBJECT (icomp), G_OBJECT (priv->vcalendar));
2b63f4
 
2b63f4
 				check_dup_uid (cbfile, comp);
2b63f4
 
2b63f4
diff --git a/src/calendar/backends/http/e-cal-backend-http.c b/src/calendar/backends/http/e-cal-backend-http.c
2b63f4
index a7e930ca0..bfe9b4554 100644
2b63f4
--- a/src/calendar/backends/http/e-cal-backend-http.c
2b63f4
+++ b/src/calendar/backends/http/e-cal-backend-http.c
2b63f4
@@ -477,13 +477,18 @@ ecb_http_get_changes_sync (ECalMetaBackend *meta_backend,
2b63f4
 	} else {
2b63f4
 		iter = i_cal_component_begin_component (maincomp, I_CAL_VCALENDAR_COMPONENT);
2b63f4
 		subcomp = i_cal_comp_iter_deref (iter);
2b63f4
+		if (subcomp)
2b63f4
+			i_cal_object_set_owner (I_CAL_OBJECT (subcomp), G_OBJECT (maincomp));
2b63f4
 	}
2b63f4
 
2b63f4
 	while (subcomp && success) {
2b63f4
 		ICalComponent *next_subcomp = NULL;
2b63f4
 
2b63f4
-		if (iter)
2b63f4
+		if (iter) {
2b63f4
 			next_subcomp = i_cal_comp_iter_next (iter);
2b63f4
+			if (next_subcomp)
2b63f4
+				i_cal_object_set_owner (I_CAL_OBJECT (next_subcomp), G_OBJECT (maincomp));
2b63f4
+		}
2b63f4
 
2b63f4
 		if (i_cal_component_isa (subcomp) == I_CAL_VCALENDAR_COMPONENT) {
2b63f4
 			success = e_cal_meta_backend_gather_timezones_sync (meta_backend, subcomp, TRUE, cancellable, error);
2b63f4
diff --git a/src/calendar/libecal/e-cal-component.c b/src/calendar/libecal/e-cal-component.c
2b63f4
index a3dddcc8f..c7629813a 100644
2b63f4
--- a/src/calendar/libecal/e-cal-component.c
2b63f4
+++ b/src/calendar/libecal/e-cal-component.c
2b63f4
@@ -95,6 +95,8 @@ foreach_subcomponent (ICalComponent *icalcomp,
2b63f4
 	while (subcomp) {
2b63f4
 		ICalComponent *next_subcomp;
2b63f4
 
2b63f4
+		i_cal_object_set_owner (I_CAL_OBJECT (subcomp), G_OBJECT (icalcomp));
2b63f4
+
2b63f4
 		next_subcomp = i_cal_comp_iter_next (iter);
2b63f4
 
2b63f4
 		if (!func (icalcomp, subcomp, user_data)) {