[glib/wip/gcleanup: 84/106] gsocketconnection: Cleanup global data



commit 0bb68e595d3fed770baf37cca205a34141a087e9
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]