From 50fb976d6a7d27a0effde1ad2f93053a34e552cb Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 17 Mar 2008 13:28:36 +0000 Subject: [PATCH] 2008-03-17 Dan Williams * src/NetworkManagerPolicy.c - (auto_activate_device): always remove the current activation check from the pending activation list, otherwise when the policy gets destroyed on NM exit it will attempt to free the already freed activation check git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3469 4912f4e0-d625-0410-9fb7-b9a5a253dbdc --- ChangeLog | 8 ++++++++ src/NetworkManagerPolicy.c | 8 +++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 38cbb2ff0..aa759aabd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-03-17 Dan Williams + + * src/NetworkManagerPolicy.c + - (auto_activate_device): always remove the current activation check + from the pending activation list, otherwise when the policy gets + destroyed on NM exit it will attempt to free the already freed + activation check + 2008-03-14 Tambet Ingo * src/backends/NetworkManagerSlackware.c diff --git a/src/NetworkManagerPolicy.c b/src/NetworkManagerPolicy.c index ebd25212b..7e3171492 100644 --- a/src/NetworkManagerPolicy.c +++ b/src/NetworkManagerPolicy.c @@ -184,6 +184,7 @@ auto_activate_device (gpointer user_data) GSList *connections, *iter; g_assert (data); + policy = data->policy; // FIXME: if a device is already activating (or activated) with a connection // but another connection now overrides the current one for that device, @@ -192,8 +193,6 @@ auto_activate_device (gpointer user_data) if (nm_device_get_act_request (data->device)) goto out; - policy = data->policy; - /* System connections first, then user connections */ connections = nm_manager_get_connections (policy->manager, NM_CONNECTION_SCOPE_SYSTEM); connections = g_slist_concat (connections, nm_manager_get_connections (policy->manager, NM_CONNECTION_SCOPE_USER)); @@ -230,13 +229,12 @@ auto_activate_device (gpointer user_data) } } - /* Remove this call's handler ID */ - policy->pending_activation_checks = g_slist_remove (policy->pending_activation_checks, data); - g_slist_foreach (connections, (GFunc) g_object_unref, NULL); g_slist_free (connections); out: + /* Remove this call's handler ID */ + policy->pending_activation_checks = g_slist_remove (policy->pending_activation_checks, data); g_object_unref (data->device); g_free (data);