From a16b7a82538e59af19557e03ae54e2e6afb5a891 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 20 Jan 2014 21:54:05 +0100 Subject: [PATCH] core: fix warning about pending action "autoactivate" Fix the following warning: add_pending_action (2): 'autoactivate' already added Signed-off-by: Thomas Haller --- src/nm-policy.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/nm-policy.c b/src/nm-policy.c index 620efda460..0a0fe3f672 100644 --- a/src/nm-policy.c +++ b/src/nm-policy.c @@ -950,10 +950,10 @@ typedef struct { static void activate_data_free (ActivateData *data) { - nm_device_remove_pending_action (data->device, "autoactivate"); - - if (data->autoactivate_id) + if (data->autoactivate_id) { + nm_device_remove_pending_action (data->device, "autoactivate"); g_source_remove (data->autoactivate_id); + } g_object_unref (data->device); memset (data, 0, sizeof (*data)); g_free (data); @@ -973,8 +973,9 @@ auto_activate_device (gpointer user_data) policy = data->policy; priv = NM_POLICY_GET_PRIVATE (policy); - data->autoactivate_id = 0; priv->pending_activation_checks = g_slist_remove (priv->pending_activation_checks, data); + data->autoactivate_id = 0; + nm_device_remove_pending_action (data->device, "autoactivate"); // FIXME: if a device is already activating (or activated) with a connection // but another connection now overrides the current one for that device, @@ -1040,7 +1041,7 @@ auto_activate_device (gpointer user_data) out: activate_data_free (data); - return FALSE; + return G_SOURCE_REMOVE; } static ActivateData *