aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Uebernickel <lars.uebernickel@canonical.com>2013-11-27 10:53:47 +0100
committerLars Uebernickel <lars.uebernickel@canonical.com>2013-11-27 10:53:47 +0100
commitee400c2adcbce249d8d005eb6c0deace6a86dd5b (patch)
tree54ab874ecbc5edbfc1d9b18c1f0fb1a687506c34
parent74a2e436b5e4e1910079e43f0a6e25ab86f5c7e4 (diff)
downloadayatana-ido-ee400c2adcbce249d8d005eb6c0deace6a86dd5b.tar.gz
ayatana-ido-ee400c2adcbce249d8d005eb6c0deace6a86dd5b.tar.bz2
ayatana-ido-ee400c2adcbce249d8d005eb6c0deace6a86dd5b.zip
idoactionhelper: remove potentially stray idle source when finalizing
-rw-r--r--src/idoactionhelper.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/idoactionhelper.c b/src/idoactionhelper.c
index a4eb51d..afa4d68 100644
--- a/src/idoactionhelper.c
+++ b/src/idoactionhelper.c
@@ -29,6 +29,7 @@ struct _IdoActionHelper
GActionGroup *actions;
gchar *action_name;
GVariant *action_target;
+ guint idle_source_id;
};
G_DEFINE_TYPE (IdoActionHelper, ido_action_helper, G_TYPE_OBJECT)
@@ -123,6 +124,7 @@ call_action_added (gpointer user_data)
ido_action_helper_action_added (helper->actions, helper->action_name, helper);
+ helper->idle_source_id = 0;
return G_SOURCE_REMOVE;
}
@@ -146,7 +148,7 @@ ido_action_helper_constructed (GObject *object)
* state-changed signal during construction (nobody could have
* connected by then).
*/
- g_idle_add (call_action_added, helper);
+ helper->idle_source_id = g_idle_add (call_action_added, helper);
}
G_OBJECT_CLASS (ido_action_helper_parent_class)->constructed (object);
@@ -219,6 +221,9 @@ ido_action_helper_finalize (GObject *object)
{
IdoActionHelper *helper = IDO_ACTION_HELPER (object);
+ if (helper->idle_source_id)
+ g_source_remove (helper->idle_source_id);
+
g_object_unref (helper->widget);
g_signal_handlers_disconnect_by_data (helper->actions, helper);