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



commit 93b7883372d588362aa93e308298cdcdbf2dc658
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 976b8c6..fb0c40b 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]