summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2020-12-08 15:41:46 +0100
committerThomas Haller <thaller@redhat.com>2020-12-08 15:41:52 +0100
commitef6edd8dbd871e267ff570395c50bb17fc509bcc (patch)
tree08ec854550cf946d9606d25ba02a13e2e7c3e0df
parentdcd0066b104850d6da4035ac942f4044ec6979ef (diff)
downloadNetworkManager-ef6edd8dbd871e267ff570395c50bb17fc509bcc.tar.gz
libnm: fix re-entrancy of NMClient.dispose() for _init_release_all()
GObject's dispose() functions may be called multiple times to break reference cycles. As dispose() calls _init_release_all(), the object might already be partially destroyed. Fixes: ce0e898fb476 ('libnm: refactor caching of D-Bus objects in NMClient')
-rw-r--r--libnm/nm-client.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libnm/nm-client.c b/libnm/nm-client.c
index ee4c0cff17..7f45397757 100644
--- a/libnm/nm-client.c
+++ b/libnm/nm-client.c
@@ -6981,7 +6981,7 @@ _init_release_all(NMClient *self)
nm_assert(c_list_is_empty(&priv->dbus_objects_lst_head_on_dbus));
nm_assert(c_list_is_empty(&priv->dbus_objects_lst_head_with_nmobj_not_ready));
nm_assert(c_list_is_empty(&priv->dbus_objects_lst_head_with_nmobj_ready));
- nm_assert(g_hash_table_size(priv->dbus_objects) == 0);
+ nm_assert(nm_g_hash_table_size(priv->dbus_objects) == 0);
}
/*****************************************************************************/
@@ -7822,7 +7822,7 @@ dispose(GObject *object)
nm_assert(c_list_is_empty(&priv->queue_notify_lst_head));
nm_assert(c_list_is_empty(&priv->notify_event_lst_head));
nm_assert(c_list_is_empty(&self->obj_base.queue_notify_lst));
- nm_assert(!priv->dbus_objects || g_hash_table_size(priv->dbus_objects) == 0);
+ nm_assert(nm_g_hash_table_size(priv->dbus_objects) == 0);
nml_dbus_property_o_clear_many(priv->nm.property_o, G_N_ELEMENTS(priv->nm.property_o), NULL);
nml_dbus_property_ao_clear_many(priv->nm.property_ao, G_N_ELEMENTS(priv->nm.property_ao), NULL);