diff options
author | Beniamino Galvani <bgalvani@redhat.com> | 2016-10-12 09:08:09 +0200 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2016-10-14 10:07:58 +0200 |
commit | 82b953d707d0803442f029cbe7e0a1e3e8754004 (patch) | |
tree | 552096944c26b1e561aea920717aa7932f39376e | |
parent | d5b3bf8ee760c7cda5daf762fe14bbe734d5d1a1 (diff) | |
download | NetworkManager-82b953d707d0803442f029cbe7e0a1e3e8754004.tar.gz |
supplicant: fix cancellation of interface association
The @assoc_cancellable was never initialized and thus ineffective; fix
this.
Furthermore, we only cancel it in nm_supplicant_interface_disconnect()
as we expect that clients call the function before destroying the
interface. Don't assume this and also cancel it in dispose().
https://bugzilla.redhat.com/show_bug.cgi?id=1383628
(cherry picked from commit 0539725aeff64a4fe3bf7b4c5ba077bba9bebb1d)
-rw-r--r-- | src/supplicant-manager/nm-supplicant-interface.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/supplicant-manager/nm-supplicant-interface.c b/src/supplicant-manager/nm-supplicant-interface.c index 626472d072..05d9aa671a 100644 --- a/src/supplicant-manager/nm-supplicant-interface.c +++ b/src/supplicant-manager/nm-supplicant-interface.c @@ -1288,6 +1288,7 @@ nm_supplicant_interface_set_config (NMSupplicantInterface *self, g_clear_object (&priv->cfg); if (cfg) { + priv->assoc_cancellable = g_cancellable_new (); priv->cfg = g_object_ref (cfg); g_dbus_proxy_call (priv->iface_proxy, DBUS_INTERFACE_PROPERTIES ".Set", @@ -1525,13 +1526,9 @@ dispose (GObject *object) g_signal_handlers_disconnect_by_data (priv->iface_proxy, NM_SUPPLICANT_INTERFACE (object)); g_clear_object (&priv->iface_proxy); - if (priv->init_cancellable) - g_cancellable_cancel (priv->init_cancellable); - g_clear_object (&priv->init_cancellable); - - if (priv->other_cancellable) - g_cancellable_cancel (priv->other_cancellable); - g_clear_object (&priv->other_cancellable); + nm_clear_g_cancellable (&priv->init_cancellable); + nm_clear_g_cancellable (&priv->other_cancellable); + nm_clear_g_cancellable (&priv->assoc_cancellable); g_clear_object (&priv->wpas_proxy); g_clear_pointer (&priv->bss_proxies, (GDestroyNotify) g_hash_table_destroy); |