device: Destroy P2P device with its parent Wifi device

This can for example happen when a wifi device is unmanaged.
This commit is contained in:
Benjamin Berg 2019-02-19 12:59:29 +01:00
parent 27bc2cb22a
commit 3e079e87a5

View file

@ -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);
}