network: Ensure devices are removed from UI when disappearing

The "removed" callback from NMObject is never called when the object is
simply finalised because the UI drops the reference. Explicitly call the
handler so that UI elements are removed.
This commit is contained in:
Benjamin Berg 2018-03-28 01:35:28 +02:00 committed by Georges Basile Stavracas Neto
parent f547d9129d
commit ec50cbcdff

View file

@ -556,6 +556,8 @@ panel_remove_device (CcNetworkPanel *panel, NMDevice *device)
if (object == NULL)
return;
/* NMObject will not fire the "removed" signal, so handle the UI removal explicitly */
object_removed_cb (object, panel);
g_ptr_array_remove (panel->devices, object);
/* update vpn widgets */