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



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

    gsocketconnection: Cleanup global data

 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]