[glib] GDBusObjectManagerClient: Don't leak object proxy when handling D-Bus signal



commit 3964e708e9a4eb7c23c0aa651ccf8bc7a57cbbf0
Author: David Zeuthen <davidz redhat com>
Date:   Tue Apr 17 17:48:08 2012 -0400

    GDBusObjectManagerClient: Don't leak object proxy when handling D-Bus signal
    
    It's g_object_unref(), not g_object_ref(). Ugh.
    
    Therefore, use g_clear_object().
    
    Signed-off-by: David Zeuthen <davidz redhat com>

 gio/gdbusobjectmanagerclient.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
---
diff --git a/gio/gdbusobjectmanagerclient.c b/gio/gdbusobjectmanagerclient.c
index a207104..1869e31 100644
--- a/gio/gdbusobjectmanagerclient.c
+++ b/gio/gdbusobjectmanagerclient.c
@@ -1089,8 +1089,7 @@ signal_cb (GDBusConnection *connection,
     }
 
  out:
-  if (object_proxy != NULL)
-    g_object_ref (object_proxy);
+  g_clear_object (&object_proxy);
 }
 
 static void



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