[glib] Plug a mem leak



commit e8fc3ba3d0dbb4e8d0592fddcbdc189c9d20056a
Author: Christian Persch <chpe gnome org>
Date:   Tue Aug 31 19:42:32 2010 +0200

    Plug a mem leak
    
    Don't leak the ptr arrays in the map_sender_unique_name_to_signal_data_array
    hash table.
    
    ==23440== 84 (20 direct, 64 indirect) bytes in 1 blocks are definitely lost in loss record 920 of 993
    ==23440==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
    ==23440==    by 0x4057094: g_malloc (gmem.c:134)
    ==23440==    by 0x406F2D6: g_slice_alloc (gslice.c:836)
    ==23440==    by 0x401D2D0: g_ptr_array_sized_new (garray.c:799)
    ==23440==    by 0x401D2AC: g_ptr_array_new (garray.c:783)
    ==23440==    by 0x420834A: g_dbus_connection_signal_subscribe (gdbusconnection.c:3084)
    
    Bug #628436.

 gio/gdbusconnection.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gio/gdbusconnection.c b/gio/gdbusconnection.c
index 26c715c..af177e7 100644
--- a/gio/gdbusconnection.c
+++ b/gio/gdbusconnection.c
@@ -826,7 +826,7 @@ g_dbus_connection_init (GDBusConnection *connection)
   connection->map_sender_unique_name_to_signal_data_array = g_hash_table_new_full (g_str_hash,
                                                                                    g_str_equal,
                                                                                    g_free,
-                                                                                   NULL);
+                                                                                   (GDestroyNotify) g_ptr_array_unref);
 
   connection->map_object_path_to_eo = g_hash_table_new_full (g_str_hash,
                                                              g_str_equal,



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