[gtk+] gesture: Don't leak stashed events
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] gesture: Don't leak stashed events
- Date: Sun, 1 May 2016 17:27:15 +0000 (UTC)
commit 0fe0ee897d8a02ee45254b6692470a520ae6f5e7
Author: Matthias Clasen <mclasen redhat com>
Date: Sun May 1 13:23:12 2016 -0400
gesture: Don't leak stashed events
These events were never freed.
gtk/gtkgesture.c | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkgesture.c b/gtk/gtkgesture.c
index 47fa3c5..8eaa518 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]