diff options
author | Thomas Haller <thaller@redhat.com> | 2018-04-21 13:25:57 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2018-04-24 10:25:26 +0200 |
commit | 3d2da8cd053034995dc580a1d65fb0b015039048 (patch) | |
tree | f4dcec187c460b1a9f30122966eaacaf8d3c61c0 /src/nm-dbus-object.c | |
parent | 5b199b2e7d5bb666f51fd8bab2abf2abc9c835a9 (diff) | |
download | NetworkManager-3d2da8cd053034995dc580a1d65fb0b015039048.tar.gz |
core/dbus: stop NMDBusManager and reject future method calls
During shutdown, we will need to still iterate the main loop
to do a coordinated shutdown. Currently we do not, and we just
exit, leaving a lot of objects hanging.
If we are going to fix that, we need during shutdown tell
NMDBusManager to reject all future operations.
Note that property getters and "GetManagerObjects" call is not
blocked. It continues to work.
Certainly for some operations, we want to allow them to be called even
during shutdown. However, these have to opt-in.
This also fixes an uglyness, where nm_dbus_manager_start() would
get the set-property-handler and the @manager as user-data. However,
NMDBusManager will always outlife NMManager, hence, after NMManager
is destroyed, the user-data would be a dangling pointer. Currently
that is not an issue, because
- we always leak NMManager
- we don't run the mainloop during shutdown
Diffstat (limited to 'src/nm-dbus-object.c')
-rw-r--r-- | src/nm-dbus-object.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/src/nm-dbus-object.c b/src/nm-dbus-object.c index 514fda4977..e92a8f5fa5 100644 --- a/src/nm-dbus-object.c +++ b/src/nm-dbus-object.c @@ -26,17 +26,6 @@ /*****************************************************************************/ -static gboolean quitting = FALSE; - -void -nm_dbus_object_set_quitting (void) -{ - nm_assert (!quitting); - quitting = TRUE; -} - -/*****************************************************************************/ - enum { EXPORTED_CHANGED, @@ -291,7 +280,7 @@ dispose (GObject *object) * we are quitting, where many objects stick around until exit. */ if (self->internal.path) { - if (!quitting) + if (!nm_dbus_manager_is_stopping (nm_dbus_object_get_manager (self))) g_warn_if_reached (); nm_dbus_object_unexport (self); } |