[gtk+/gestures] GtkSpinButton: Don't leak the gestures



commit d3431c3ceaced2fca77aff6abe9da31a2107027d
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu May 1 22:05:42 2014 -0400

    GtkSpinButton: Don't leak the gestures

 gtk/gtkspinbutton.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c
index 38a8638..ac725ca 100644
--- a/gtk/gtkspinbutton.c
+++ b/gtk/gtkspinbutton.c
@@ -751,6 +751,14 @@ gtk_spin_button_finalize (GObject *object)
   if (priv->up_panel_context)
     g_object_unref (priv->up_panel_context);
 
+  gtk_widget_remove_controller (GTK_WIDGET (spin_button),
+                                GTK_EVENT_CONTROLLER (priv->long_press_gesture));
+  g_object_unref (priv->long_press_gesture);
+
+  gtk_widget_add_controller (GTK_WIDGET (spin_button),
+                             GTK_EVENT_CONTROLLER (priv->swipe_gesture));
+  g_object_unref (priv->swipe_gesture);
+
   G_OBJECT_CLASS (gtk_spin_button_parent_class)->finalize (object);
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]