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.
This commit is contained in:
Dan Williams
2015-07-23 10:03:21 -05:00
committed by Thomas Haller
parent d518278011
commit f9ee20a7b2
11 changed files with 75 additions and 47 deletions

View File

@@ -50,6 +50,7 @@
#include "nm-settings.h"
#include "nm-auth-manager.h"
#include "nm-core-internal.h"
#include "nm-exported-object.h"
#if !defined(NM_DIST_VERSION)
# define NM_DIST_VERSION VERSION
@@ -454,6 +455,8 @@ main (int argc, char *argv[])
if (configure_and_quit == FALSE)
g_main_loop_run (main_loop);
nm_exported_object_class_set_quitting ();
nm_manager_stop (nm_manager_get ());
done: