[at-spi2-atk] socket-adaptor: fix memory leak



commit cbb481387d3a0cce0690c03a3049ecaa7320545f
Author: Xan Lopez <xan igalia com>
Date:   Wed Mar 27 21:40:12 2013 +0100

    socket-adaptor: fix memory leak
    
    Set a destructor for the object data. Other than fixing a leak this
    also allows to simplify the code a bit.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=696733

 atk-adaptor/adaptors/socket-adaptor.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)
---
diff --git a/atk-adaptor/adaptors/socket-adaptor.c b/atk-adaptor/adaptors/socket-adaptor.c
index d7ebe5f..9aff7d7 100644
--- a/atk-adaptor/adaptors/socket-adaptor.c
+++ b/atk-adaptor/adaptors/socket-adaptor.c
@@ -173,11 +173,8 @@ impl_Embedded (DBusConnection *bus,
     {
       return droute_invalid_arguments_error (message);
     }
-  id = g_object_get_data (G_OBJECT (object), "dbus-plug-parent");
-  if (id)
-    g_free (id);
   id = g_strconcat (dbus_message_get_sender (message), ":", path, NULL);
-  g_object_set_data (G_OBJECT (object), "dbus-plug-parent", id);
+  g_object_set_data_full (G_OBJECT (object), "dbus-plug-parent", id, (GDestroyNotify)g_free);
 
   if (ATK_IS_COMPONENT (object))
     {


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