gesture: Don't leak stashed events

These events were never freed.
This commit is contained in:
Matthias Clasen 2016-05-01 13:23:12 -04:00
parent a047269428
commit 0fe0ee897d

View File

@ -993,6 +993,17 @@ gtk_gesture_class_init (GtkGestureClass *klass)
GTK_TYPE_EVENT_SEQUENCE_STATE);
}
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)
{
@ -1000,7 +1011,7 @@ gtk_gesture_init (GtkGesture *gesture)
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);