[glib] Make g_simple_async_result_is_valid work without source



commit 7de6658f74a43065fa9a27db6cb4d26b6a946a32
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Aug 7 17:08:54 2010 -0400

    Make g_simple_async_result_is_valid work without source
    
    The problem was pointed out by Xavier Claessens in bug 626208.

 gio/gsimpleasyncresult.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/gio/gsimpleasyncresult.c b/gio/gsimpleasyncresult.c
index 71387fa..b68684a 100644
--- a/gio/gsimpleasyncresult.c
+++ b/gio/gsimpleasyncresult.c
@@ -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);
 }



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