From 3e079e87a5a67384aa05c894aa536507838f985a Mon Sep 17 00:00:00 2001 From: Benjamin Berg Date: Tue, 19 Feb 2019 12:59:29 +0100 Subject: [PATCH] device: Destroy P2P device with its parent Wifi device This can for example happen when a wifi device is unmanaged. --- src/devices/wifi/nm-device-wifi.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/devices/wifi/nm-device-wifi.c b/src/devices/wifi/nm-device-wifi.c index 6f23bf15cd..63eafe71bc 100644 --- a/src/devices/wifi/nm-device-wifi.c +++ b/src/devices/wifi/nm-device-wifi.c @@ -3396,6 +3396,12 @@ dispose (GObject *object) remove_all_aps (self); + if (priv->p2p_device) { + /* Destroy the P2P device. */ + g_object_remove_weak_pointer (G_OBJECT (priv->p2p_device), (gpointer*) &priv->p2p_device); + nm_device_wifi_p2p_remove (g_steal_pointer (&priv->p2p_device)); + } + G_OBJECT_CLASS (nm_device_wifi_parent_class)->dispose (object); }