summaryrefslogtreecommitdiff
path: root/monitor/proxy
diff options
context:
space:
mode:
authorTomas Bzatek <tbzatek@redhat.com>2012-12-10 15:37:54 +0100
committerTomas Bzatek <tbzatek@redhat.com>2012-12-10 15:37:54 +0100
commit5a6d6ddc66a4bc32aef99f73c9e99a1c3ca91bff (patch)
tree79611432e4d6c2ef483e3c1e2d32af0cbe9a2a46 /monitor/proxy
parentee170849f84ecb09caf6dc49611db9db812f060c (diff)
downloadgvfs-5a6d6ddc66a4bc32aef99f73c9e99a1c3ca91bff.tar.gz
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
Diffstat (limited to 'monitor/proxy')
-rw-r--r--monitor/proxy/gproxyvolumemonitor.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/monitor/proxy/gproxyvolumemonitor.c b/monitor/proxy/gproxyvolumemonitor.c
index 823c1689..4a209573 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;