summaryrefslogtreecommitdiff
path: root/src/nm-manager.c
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2015-07-23 10:03:21 -0500
committerThomas Haller <thaller@redhat.com>2015-11-10 18:12:12 +0100
commitf9ee20a7b2bd364384af2487da357344fd61a6b9 (patch)
treebb8a1a67b6979ecf982661a8cf752f66d7da7b6d /src/nm-manager.c
parentd51827801128564c31dc5f9cc31db18f1bf7ae79 (diff)
downloadNetworkManager-f9ee20a7b2bd364384af2487da357344fd61a6b9.tar.gz
core: explicitly unexport objects when we're done with them
Previously most objects were implicitly unexported when they were destroyed, but since refcounts may make the object live longer than intended, we should explicitly unexport them when they should no longer be present on the bus. This means we can assume that objects will always be un-exported already when they are destroyed, *except* when quitting where most objects will live until exit because NM leaves interfaces up and running on quit.
Diffstat (limited to 'src/nm-manager.c')
-rw-r--r--src/nm-manager.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/nm-manager.c b/src/nm-manager.c
index a3d4117008..5cba730fec 100644
--- a/src/nm-manager.c
+++ b/src/nm-manager.c
@@ -225,7 +225,7 @@ active_connection_remove (NMManager *self, NMActiveConnection *active)
else
connection = NULL;
- g_object_unref (active);
+ nm_exported_object_clear_and_unexport (&active);
if ( connection
&& nm_settings_has_connection (priv->settings, connection)) {
@@ -801,8 +801,7 @@ remove_device (NMManager *manager,
g_object_notify (G_OBJECT (manager), NM_MANAGER_DEVICES);
nm_device_removed (device);
- nm_exported_object_unexport (NM_EXPORTED_OBJECT (device));
- g_object_unref (device);
+ nm_exported_object_clear_and_unexport (&device);
check_if_startup_complete (manager);
}