summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLionel Landwerlin <llandwerlin@gmail.com>2013-09-09 07:52:55 +0100
committerLionel Landwerlin <llandwerlin@gmail.com>2013-09-10 21:48:42 +0100
commit5c035f2107cda24a074246d6b083296da2526c07 (patch)
treec000cf6a05da2eb693f4076457034a96be98bf10
parent142c1bbee7b46cf390eb375149da618a466f56bb (diff)
downloadclutter-5c035f2107cda24a074246d6b083296da2526c07.tar.gz
click-action: disconnect signals and gsources on dispose
https://bugzilla.gnome.org/show_bug.cgi?id=707774
-rw-r--r--clutter/clutter-click-action.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/clutter/clutter-click-action.c b/clutter/clutter-click-action.c
index 8e7963cf1..92aba0b70 100644
--- a/clutter/clutter-click-action.c
+++ b/clutter/clutter-click-action.c
@@ -535,6 +535,34 @@ clutter_click_action_get_property (GObject *gobject,
}
static void
+clutter_click_action_dispose (GObject *gobject)
+{
+ ClutterClickActionPrivate *priv = CLUTTER_CLICK_ACTION (gobject)->priv;
+
+ if (priv->event_id)
+ {
+ g_signal_handler_disconnect (clutter_actor_meta_get_actor (CLUTTER_ACTOR_META (gobject)),
+ priv->event_id);
+ priv->event_id = 0;
+ }
+
+ if (priv->capture_id)
+ {
+ g_signal_handler_disconnect (priv->stage, priv->capture_id);
+ priv->capture_id = 0;
+ }
+
+ if (priv->long_press_id)
+ {
+ g_source_remove (priv->long_press_id);
+ priv->long_press_id = 0;
+ }
+
+ G_OBJECT_CLASS (clutter_click_action_parent_class)->dispose (gobject);
+}
+
+
+static void
clutter_click_action_class_init (ClutterClickActionClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
@@ -542,6 +570,7 @@ clutter_click_action_class_init (ClutterClickActionClass *klass)
meta_class->set_actor = clutter_click_action_set_actor;
+ gobject_class->dispose = clutter_click_action_dispose;
gobject_class->set_property = clutter_click_action_set_property;
gobject_class->get_property = clutter_click_action_get_property;