From 28e67c7d73e9064b6588e4e893ae9db9d76d665d Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Thu, 3 Oct 2013 09:52:24 -0400 Subject: [PATCH] libnm-glib: fix the leak that breaks the shell network status icon All NMObjects created in response to property changes were getting leaked, which in particular included all NMAccessPoint objects, which meant that after disconnecting and reconnecting a wifi interface some number of times (depending on how many access points were in the area), gnome-shell would be watching so many D-Bus AccessPoint objects (most of which didn't exist any more) that it would hit dbus-daemon's limit on the number of match rules you can register, which meant that NMActiveConnections created after that point wouldn't be able to register for PropertiesChanged notifications, which meant that the network status icon would get out of sync. --- libnm-glib/nm-object.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/libnm-glib/nm-object.c b/libnm-glib/nm-object.c index c9850183fe..c69b0cae39 100644 --- a/libnm-glib/nm-object.c +++ b/libnm-glib/nm-object.c @@ -264,16 +264,14 @@ init_async_got_manager_running (DBusGProxy *proxy, DBusGProxyCall *call, G_TYPE_BOOLEAN, &priv->nm_running, G_TYPE_INVALID)) { init_async_complete (simple, error); - return; - } - - if (!priv->nm_running) { + } else if (!priv->nm_running) { priv->inited = TRUE; init_async_complete (simple, NULL); - return; - } + } else + _nm_object_reload_properties_async (self, init_async_got_properties, simple); - _nm_object_reload_properties_async (self, init_async_got_properties, simple); + /* g_async_result_get_source_object() adds a ref */ + g_object_unref (self); } static void