summaryrefslogtreecommitdiff
path: root/src/nm-policy.c
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2013-08-30 17:57:56 -0500
committerDan Williams <dcbw@redhat.com>2013-08-30 18:00:18 -0500
commit1a42e764d4376400f2db29319ce86f9570efc2ef (patch)
treea9377e488d3bc403d76bbf8fca770d3c442d7427 /src/nm-policy.c
parentc6ba3ca51b960901e86c45eaf65ed18dd8efa57f (diff)
downloadNetworkManager-1a42e764d4376400f2db29319ce86f9570efc2ef.tar.gz
core: fix handling of ActiveConnections on Policy dispose()
The manager has already disposed of the ActiveConnections by the time the Policy is disposed, but the manager wasn't clearing the active_connections list, so the Policy got a stale list of freed objects. Next, the manager wasn't always emitting ACTIVE_CONNECTION_REMOVED when disposing of ActiveConnections, which the Policy listens to for cleanup. This lead to warnings on shutdown when the Policy attempted to clean up for already disposed objects Fix all this by ensuring the Manager signals when removing ActiveConnections, which the Policy then uses to clean up it's stuff, and ensuring the manager properly cleans up its ActiveConnection list.
Diffstat (limited to 'src/nm-policy.c')
-rw-r--r--src/nm-policy.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/nm-policy.c b/src/nm-policy.c
index 509343eeef..aca9d612b0 100644
--- a/src/nm-policy.c
+++ b/src/nm-policy.c
@@ -2182,9 +2182,12 @@ dispose (GObject *object)
}
g_clear_pointer (&priv->dev_ids, g_slist_free);
+ /* 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.
+ */
connections = nm_manager_get_active_connections (priv->manager);
- for (iter = connections; iter; iter = g_slist_next (iter))
- active_connection_removed (priv->manager, NM_ACTIVE_CONNECTION (iter->data), policy);
+ g_assert (connections == NULL);
if (priv->reset_retries_id) {
g_source_remove (priv->reset_retries_id);