[glib/wip/gcleanup: 53/78] gsocketconnection: Cleanup global data



commit f7814ae04b6ec116c965ae71d2687f5e55c3d769
Author: Stef Walter <stefw gnome org>
Date:   Thu Nov 7 23:01:48 2013 +0100

    gsocketconnection: Cleanup global data
    
    https://bugzilla.gnome.org/show_bug.cgi?id=711799

 gio/gsocketconnection.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/gio/gsocketconnection.c b/gio/gsocketconnection.c
index ac1db4a..504d276 100644
--- a/gio/gsocketconnection.c
+++ b/gio/gsocketconnection.c
@@ -559,10 +559,13 @@ g_socket_connection_factory_register_type (GType         g_type,
   G_LOCK (connection_factories);
 
   if (connection_factories == NULL)
-    connection_factories = g_hash_table_new_full (connection_factory_hash,
-                                                 connection_factory_equal,
-                                                 (GDestroyNotify)g_free,
-                                                 NULL);
+    {
+      connection_factories = g_hash_table_new_full (connection_factory_hash,
+                                                    connection_factory_equal,
+                                                    (GDestroyNotify)g_free,
+                                                    NULL);
+      G_CLEANUP (connection_factories, g_hash_table_unref);
+    }
 
   factory = g_new0 (ConnectionFactory, 1);
   factory->socket_family = family;


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