r7164 - dumbhippo/trunk/client/common/ddm



Author: otaylor
Date: 2008-01-09 16:05:02 -0600 (Wed, 09 Jan 2008)
New Revision: 7164

Modified:
   dumbhippo/trunk/client/common/ddm/ddm-work-item.c
Log:
Add some robustness against resources with no received fetch specified

Modified: dumbhippo/trunk/client/common/ddm/ddm-work-item.c
===================================================================
--- dumbhippo/trunk/client/common/ddm/ddm-work-item.c	2008-01-09 22:04:40 UTC (rev 7163)
+++ dumbhippo/trunk/client/common/ddm/ddm-work-item.c	2008-01-09 22:05:02 UTC (rev 7164)
@@ -46,7 +46,7 @@
     WorkItemNotifyResource *notify_resource = g_new0(WorkItemNotifyResource, 1);
     
     notify_resource->resource = resource;
-    notify_resource->fetch = ddm_data_fetch_ref(fetch);
+    notify_resource->fetch = fetch ? ddm_data_fetch_ref(fetch) : NULL;
     notify_resource->changed_properties = g_slist_copy(changed_properties);
 
     return notify_resource;
@@ -55,7 +55,8 @@
 static void
 work_item_notify_resource_free (WorkItemNotifyResource *notify_resource)
 {
-    ddm_data_fetch_unref(notify_resource->fetch);
+    if (notify_resource->fetch)
+        ddm_data_fetch_unref(notify_resource->fetch);
     g_slist_free(notify_resource->changed_properties);
     
     g_free(notify_resource);
@@ -197,7 +198,7 @@
         if (received_fetch != NULL) {
             unreceived_fetch = ddm_data_fetch_subtract(fetch, received_fetch);
         } else {
-            unreceived_fetch = ddm_data_fetch_ref(fetch);
+            unreceived_fetch = fetch? ddm_data_fetch_ref(fetch) : NULL;
         }
 
         if (unreceived_fetch != NULL) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]