summaryrefslogtreecommitdiff
path: root/libnm-glib/nm-client.c
diff options
context:
space:
mode:
authorDan Winship <danw@gnome.org>2014-07-31 09:21:05 -0400
committerDan Winship <danw@gnome.org>2014-08-01 12:12:42 -0400
commitfe264a2d01245d1cc814f5df6f86623bb8b35aef (patch)
tree045d41c6120b9d98859e7dc930fca8cb1f81d188 /libnm-glib/nm-client.c
parent08b91199fb95d9178feaeaa58381847332f22ad8 (diff)
libnm-glib: fix a crash when using multiple NMClients
NMObjectCache was assuming there would never be more than one object with the same path, but since NMClient is an NMObject, it was getting cached too, so if you created two clients and then unreffed one of them, it's possible the wrong one could get left in the cache, causing a crash the next time the other one called nm_object_cache_clear(). Fix this by only adding NMObjects to the cache in the codepaths where we also check to see if the object was already in the cache. (This also means we can remove the "except" argument to nm_object_cache_clear(), since the NMClient won't be cached any more.)
Diffstat (limited to 'libnm-glib/nm-client.c')
-rw-r--r--libnm-glib/nm-client.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libnm-glib/nm-client.c b/libnm-glib/nm-client.c
index c020f9ffdb..711da7f4a0 100644
--- a/libnm-glib/nm-client.c
+++ b/libnm-glib/nm-client.c
@@ -1383,7 +1383,7 @@ proxy_name_owner_changed (DBusGProxy *proxy,
/* Clear object cache to ensure bad refcounting by clients doesn't
* keep objects in the cache.
*/
- _nm_object_cache_clear (NM_OBJECT (client));
+ _nm_object_cache_clear ();
} else {
_nm_object_suppress_property_updates (NM_OBJECT (client), FALSE);
_nm_object_reload_properties_async (NM_OBJECT (client), updated_properties, client);