mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-07 03:10:16 +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.
(cherry picked from commit 004edecc81)
This commit is contained in:
parent
91bdabc808
commit
213c20142c
1 changed files with 3 additions and 1 deletions
|
|
@ -200,9 +200,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