Make g_simple_async_result_is_valid work without source
authorMatthias Clasen <mclasen@redhat.com>
Sat, 7 Aug 2010 21:08:54 +0000 (17:08 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 7 Aug 2010 21:10:17 +0000 (17:10 -0400)
The problem was pointed out by Xavier Claessens in bug 626208.

gio/gsimpleasyncresult.c

index 71387fa..b68684a 100644 (file)
@@ -757,10 +757,12 @@ g_simple_async_result_is_valid (GAsyncResult *result,
   cmp_source = g_async_result_get_source_object (result);
   if (cmp_source != source)
     {
-      g_object_unref (cmp_source);
+      if (cmp_source != NULL)
+        g_object_unref (cmp_source);
       return FALSE;
     }
-  g_object_unref (cmp_source);
+  if (cmp_source != NULL)
+    g_object_unref (cmp_source);
 
   return source_tag == g_simple_async_result_get_source_tag (simple);
 }