Commit 29c4d0a3 authored by Debarshi Ray's avatar Debarshi Ray

GtkGestureZoom: Don't leak the list of sequences

https://bugzilla.gnome.org/show_bug.cgi?id=789149
parent 45198d23
......@@ -79,17 +79,18 @@ _gtk_gesture_zoom_get_distance (GtkGestureZoom *zoom,
const GdkEvent *last_event;
gdouble x1, y1, x2, y2;
GtkGesture *gesture;
GList *sequences;
GList *sequences = NULL;
gdouble dx, dy;
gboolean retval = FALSE;
gesture = GTK_GESTURE (zoom);
if (!gtk_gesture_is_recognized (gesture))
return FALSE;
goto out;
sequences = gtk_gesture_get_sequences (gesture);
if (!sequences)
return FALSE;
goto out;
last_event = gtk_gesture_get_last_event (gesture, sequences->data);
......@@ -104,18 +105,21 @@ _gtk_gesture_zoom_get_distance (GtkGestureZoom *zoom,
else
{
if (!sequences->next)
return FALSE;
goto out;
gtk_gesture_get_point (gesture, sequences->data, &x1, &y1);
gtk_gesture_get_point (gesture, sequences->next->data, &x2, &y2);
g_list_free (sequences);
dx = x1 - x2;
dy = y1 - y2;;
*distance = sqrt ((dx * dx) + (dy * dy));
}
return TRUE;
retval = TRUE;
out:
g_list_free (sequences);
return retval;
}
static gboolean
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment