mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-03-05 04:10:36 +01:00
core: assert that devices are not registered when disposing NMPolicy
NMDevice holds a reference to NMManager, which holds a reference to NMPolicy.
It is not possible that we try to dispose NMPolicy while there are still devices
registered. That would be a bug, that we need to find and solve
differently. Add an assertion instead of trying to handle it.
(cherry picked from commit aede228974)
This commit is contained in:
parent
3b05cbc33b
commit
d412eb8aca
1 changed files with 3 additions and 13 deletions
|
|
@ -2885,8 +2885,9 @@ dispose(GObject *object)
|
|||
{
|
||||
NMPolicy *self = NM_POLICY(object);
|
||||
NMPolicyPrivate *priv = NM_POLICY_GET_PRIVATE(self);
|
||||
GHashTableIter h_iter;
|
||||
NMDevice *device;
|
||||
|
||||
nm_assert(!c_list_is_empty(&priv->policy_auto_activate_lst_head));
|
||||
nm_assert(g_hash_table_size(priv->devices) == 0);
|
||||
|
||||
nm_clear_g_object(&priv->default_ac4);
|
||||
nm_clear_g_object(&priv->default_ac6);
|
||||
|
|
@ -2894,11 +2895,6 @@ dispose(GObject *object)
|
|||
nm_clear_g_object(&priv->activating_ac6);
|
||||
nm_clear_pointer(&priv->pending_active_connections, g_hash_table_unref);
|
||||
|
||||
while ((device = c_list_first_entry(&priv->policy_auto_activate_lst_head,
|
||||
NMDevice,
|
||||
policy_auto_activate_lst)))
|
||||
_auto_activate_device_clear(self, device, FALSE);
|
||||
|
||||
g_slist_free_full(priv->pending_secondaries, (GDestroyNotify) pending_secondary_data_free);
|
||||
priv->pending_secondaries = NULL;
|
||||
|
||||
|
|
@ -2917,12 +2913,6 @@ dispose(GObject *object)
|
|||
g_clear_object(&priv->dns_manager);
|
||||
}
|
||||
|
||||
g_hash_table_iter_init(&h_iter, priv->devices);
|
||||
while (g_hash_table_iter_next(&h_iter, (gpointer *) &device, NULL)) {
|
||||
g_hash_table_iter_remove(&h_iter);
|
||||
devices_list_unregister(self, device);
|
||||
}
|
||||
|
||||
/* The manager should have disposed of ActiveConnections already, which
|
||||
* will have called active_connection_removed() and thus we don't need
|
||||
* to clean anything up. Assert that this is TRUE.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue