mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-25 00:10:07 +01:00
device: remove the unreferenced unreal devices
When there's no connection that would use an unrealized device there's no more reason to keep the device in memory. It's in fact a resource leak.
This commit is contained in:
parent
a22a109ad6
commit
436ec5b8e3
1 changed files with 5 additions and 0 deletions
|
|
@ -2068,6 +2068,11 @@ nm_device_unrealize (NMDevice *self, gboolean remove_resources, GError **error)
|
|||
remove_resources ?
|
||||
NM_DEVICE_STATE_REASON_USER_REQUESTED : NM_DEVICE_STATE_REASON_NOW_UNMANAGED);
|
||||
|
||||
/* Garbage-collect unneeded unrealized devices. */
|
||||
nm_device_recheck_available_connections (self);
|
||||
if (g_hash_table_size (priv->available_connections) == 0)
|
||||
g_signal_emit_by_name (self, NM_DEVICE_REMOVED);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue