From 82b953d707d0803442f029cbe7e0a1e3e8754004 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Wed, 12 Oct 2016 09:08:09 +0200 Subject: 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) --- src/supplicant-manager/nm-supplicant-interface.c | 11 ++++------- 1 file 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); -- cgit v1.2.1