mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-27 05:50:32 +01:00
wifi/supplicant: take object reference during availability_changed()
If the list is expected to be modified, it also means that possibly instances will be unrefed. Probably, not yet visited instances will not be unrefed so there is no real problem. Just be extra cautious and take a reference to all instances first.
This commit is contained in:
parent
8dcf4d32e9
commit
004edecc81
1 changed files with 3 additions and 1 deletions
|
|
@ -198,9 +198,11 @@ availability_changed (NMSupplicantManager *self, gboolean available)
|
|||
|
||||
/* priv->ifaces may be modified if availability changes; can't use GHashTableIter */
|
||||
ifaces = g_hash_table_get_values (priv->ifaces);
|
||||
for (iter = ifaces; iter; iter = iter->next)
|
||||
g_object_ref (iter->data);
|
||||
for (iter = ifaces; iter; iter = iter->next)
|
||||
nm_supplicant_interface_set_supplicant_available (NM_SUPPLICANT_INTERFACE (iter->data), available);
|
||||
g_list_free (ifaces);
|
||||
g_list_free_full (ifaces, g_object_unref);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue