[gvfs] proxy volume monitor: Don't leak the_volume_monitors hash table



commit 5a6d6ddc66a4bc32aef99f73c9e99a1c3ca91bff
Author: Tomas Bzatek <tbzatek redhat com>
Date:   Mon Dec 10 15:37:54 2012 +0100

    proxy volume monitor: Don't leak the_volume_monitors hash table
    
    The the_volume_monitors hash table is a shared global instance, make
    sure to only initialize it once.
    
    Based on a patch by Tim Lunn <tim feathertop org>
    
    https://bugzilla.gnome.org/show_bug.cgi?id=689946

 monitor/proxy/gproxyvolumemonitor.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/monitor/proxy/gproxyvolumemonitor.c b/monitor/proxy/gproxyvolumemonitor.c
index 823c168..4a20957 100644
--- a/monitor/proxy/gproxyvolumemonitor.c
+++ b/monitor/proxy/gproxyvolumemonitor.c
@@ -1411,7 +1411,8 @@ g_proxy_volume_monitor_setup_session_bus_connection (void)
   if (g_getenv ("DBUS_SESSION_BUS_ADDRESS") == NULL)
     goto out;
 
-  the_volume_monitors = g_hash_table_new (g_direct_hash, g_direct_equal);
+  if (the_volume_monitors == NULL)
+    the_volume_monitors = g_hash_table_new (g_direct_hash, g_direct_equal);
 
   ret = TRUE;
 



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