[glib/wip/gcleanup: 30/42] gdbusname: Cleanup global tables



commit 19ea5e46353d3417616dd044a61ec5e5e1e12bdc
Author: Stef Walter <stefw gnome org>
Date:   Sat Nov 9 20:15:56 2013 +0100

    gdbusname: Cleanup global tables
    
    https://bugzilla.gnome.org/show_bug.cgi?id=711799

 gio/gdbusnameowning.c   |    1 +
 gio/gdbusnamewatching.c |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/gio/gdbusnameowning.c b/gio/gdbusnameowning.c
index 791d2f5..0ddfafc 100644
--- a/gio/gdbusnameowning.c
+++ b/gio/gdbusnameowning.c
@@ -650,6 +650,7 @@ g_bus_own_name (GBusType                  bus_type,
   if (map_id_to_client == NULL)
     {
       map_id_to_client = g_hash_table_new (g_direct_hash, g_direct_equal);
+      G_CLEANUP_IN (map_id_to_client, g_hash_table_unref, G_CLEANUP_PHASE_LATE);
     }
   g_hash_table_insert (map_id_to_client,
                        GUINT_TO_POINTER (client->id),
diff --git a/gio/gdbusnamewatching.c b/gio/gdbusnamewatching.c
index 12e8ed7..77a1b52 100644
--- a/gio/gdbusnamewatching.c
+++ b/gio/gdbusnamewatching.c
@@ -574,6 +574,7 @@ g_bus_watch_name (GBusType                  bus_type,
   if (map_id_to_client == NULL)
     {
       map_id_to_client = g_hash_table_new (g_direct_hash, g_direct_equal);
+      G_CLEANUP_IN (map_id_to_client, g_hash_table_unref, G_CLEANUP_PHASE_LATE);
     }
   g_hash_table_insert (map_id_to_client,
                        GUINT_TO_POINTER (client->id),


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