Bug #707520 - New detached instance notification not send to clients
authorMilan Crha <mcrha@redhat.com>
Thu, 5 Sep 2013 07:38:01 +0000 (09:38 +0200)
committerMilan Crha <mcrha@redhat.com>
Thu, 5 Sep 2013 07:38:01 +0000 (09:38 +0200)
calendar/libedata-cal/e-cal-backend.c
calendar/libedata-cal/e-data-cal.c

index 47a38ce..781221d 100644 (file)
@@ -2654,8 +2654,8 @@ e_cal_backend_modify_objects_finish (ECalBackend *backend,
                e_cal_backend_notify_component_modified (
                        backend, old_component, new_component);
 
-               g_object_unref (old_component);
-               g_object_unref (new_component);
+               g_clear_object (&old_component);
+               g_clear_object (&new_component);
        }
 
        g_warn_if_fail (g_queue_is_empty (old_component_queue));
@@ -4147,7 +4147,7 @@ e_cal_backend_notify_component_modified (ECalBackend *backend,
        GList *list, *link;
 
        g_return_if_fail (E_IS_CAL_BACKEND (backend));
-       g_return_if_fail (E_IS_CAL_COMPONENT (old_component));
+       g_return_if_fail (!old_component || E_IS_CAL_COMPONENT (old_component));
        g_return_if_fail (E_IS_CAL_COMPONENT (new_component));
 
        list = e_cal_backend_list_views (backend);
index 8d774c0..17315b2 100644 (file)
@@ -1796,10 +1796,13 @@ e_data_cal_respond_modify_objects (EDataCal *cal,
 
                list = (GSList *) old_components;
 
-               for (link = list; link != NULL; link = g_slist_next (link))
+               for (link = list; link != NULL; link = g_slist_next (link)) {
+                       if (link->data)
+                               g_object_ref (link->data);
                        g_queue_push_tail (
                                inner_queue,
-                               g_object_ref (link->data));
+                               link->data);
+               }
 
                g_queue_push_tail (queue, inner_queue);
 
@@ -1882,10 +1885,13 @@ e_data_cal_respond_remove_objects (EDataCal *cal,
 
                list = (GSList *) old_components;
 
-               for (link = list; link != NULL; link = g_slist_next (link))
+               for (link = list; link != NULL; link = g_slist_next (link)) {
+                       if (link->data)
+                               g_object_ref (link->data);
                        g_queue_push_tail (
                                inner_queue,
-                               g_object_ref (link->data));
+                               link->data);
+               }
 
                g_queue_push_tail (queue, inner_queue);
 
@@ -1899,8 +1905,8 @@ e_data_cal_respond_remove_objects (EDataCal *cal,
                        for (link = list; link != NULL; link = g_slist_next (link)) {
                                if (link->data != NULL)
                                        g_object_ref (link->data);
-                                       g_queue_push_tail (
-                                               inner_queue, link->data);
+                               g_queue_push_tail (
+                                       inner_queue, link->data);
                        }
 
                        g_queue_push_tail (queue, inner_queue);