diff options
author | Thomas Haller <thaller@redhat.com> | 2017-03-14 17:39:26 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2017-03-15 10:33:44 +0100 |
commit | 0d1c8bc9ebb24d49fa30625462476f1fbe6bfdb8 (patch) | |
tree | 355d69146f19647e16872fbf71ac7360c0aad3b0 | |
parent | 59dc6298c0c37e7a01462fd7479547e6969ef74f (diff) | |
download | NetworkManager-0d1c8bc9ebb24d49fa30625462476f1fbe6bfdb8.tar.gz |
manager: disconnect NMSetting's startup-complete notification in check_if_startup_complete()
This doesn't really matter, because NMSetting's startup-complete never
switches back to FALSE once reached. Still, cleanup our signal handlers
when no longer needed.
And disconnect the signals before emitting "notify::startup".
-rw-r--r-- | src/nm-manager.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/nm-manager.c b/src/nm-manager.c index 39c3309fc1..5b9b144891 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -86,6 +86,10 @@ static void device_sleep_cb (NMDevice *device, GParamSpec *pspec, NMManager *self); +static void settings_startup_complete_changed (NMSettings *settings, + GParamSpec *pspec, + NMManager *self); + static NM_CACHED_QUARK_FCN ("active-connection-add-and-activate", active_connection_add_and_activate_quark) typedef struct { @@ -940,15 +944,18 @@ check_if_startup_complete (NMManager *self) _LOGI (LOGD_CORE, "startup complete"); priv->startup = FALSE; - _notify (self, PROP_STARTUP); - /* We don't have to watch notify::has-pending-action any more. */ + /* we no longer care about these signals. Startup-complete only + * happens once. */ + g_signal_handlers_disconnect_by_func (priv->settings, G_CALLBACK (settings_startup_complete_changed), self); for (iter = priv->devices; iter; iter = iter->next) { - NMDevice *dev = iter->data; - - g_signal_handlers_disconnect_by_func (dev, G_CALLBACK (device_has_pending_action_changed), self); + g_signal_handlers_disconnect_by_func (iter->data, + G_CALLBACK (device_has_pending_action_changed), + self); } + _notify (self, PROP_STARTUP); + if (nm_config_get_configure_and_quit (priv->config)) g_signal_emit (self, signals[CONFIGURE_QUIT], 0); } |