diff options
author | Dan Winship <danw@gnome.org> | 2013-10-03 09:52:24 -0400 |
---|---|---|
committer | Dan Winship <danw@gnome.org> | 2013-10-03 11:04:45 -0400 |
commit | 28e67c7d73e9064b6588e4e893ae9db9d76d665d (patch) | |
tree | 5d52f97c7618fed55aa6c74aa133d7b7c9d85f59 | |
parent | 8695410d8692aa016f764803d5b7cfa4618ba5d6 (diff) | |
download | NetworkManager-28e67c7d73e9064b6588e4e893ae9db9d76d665d.tar.gz |
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.
-rw-r--r-- | libnm-glib/nm-object.c | 12 |
1 files 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 |