summaryrefslogtreecommitdiff
path: root/gtk/gtkgesture.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2016-05-01 13:23:12 -0400
committerMatthias Clasen <mclasen@redhat.com>2016-05-01 13:26:35 -0400
commit0fe0ee897d8a02ee45254b6692470a520ae6f5e7 (patch)
treed3282f55fa7af6fdaef9d03466218b0a7d7a9137 /gtk/gtkgesture.c
parenta0472694283490a39392d1158e7a2e379962af79 (diff)
downloadgtk+-0fe0ee897d8a02ee45254b6692470a520ae6f5e7.tar.gz
gesture: Don't leak stashed events
These events were never freed.
Diffstat (limited to 'gtk/gtkgesture.c')
-rw-r--r--gtk/gtkgesture.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/gtk/gtkgesture.c b/gtk/gtkgesture.c
index 47fa3c56ce..8eaa518778 100644
--- a/gtk/gtkgesture.c
+++ b/gtk/gtkgesture.c
@@ -994,13 +994,24 @@ gtk_gesture_class_init (GtkGestureClass *klass)
}
static void
+free_point_data (gpointer data)
+{
+ PointData *point = data;
+
+ if (point->event)
+ gdk_event_free (point->event);
+
+ g_free (point);
+}
+
+static void
gtk_gesture_init (GtkGesture *gesture)
{
GtkGesturePrivate *priv;
priv = gtk_gesture_get_instance_private (gesture);
priv->points = g_hash_table_new_full (NULL, NULL, NULL,
- (GDestroyNotify) g_free);
+ (GDestroyNotify) free_point_data);
gtk_event_controller_set_event_mask (GTK_EVENT_CONTROLLER (gesture),
GDK_TOUCH_MASK |
GDK_TOUCHPAD_GESTURE_MASK);