[gtk+/gtk-3-2] gdk: Plug leak in gdk_display_pointer_is_grabbed
- From: Adel Gadllah <agadllah src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-3-2] gdk: Plug leak in gdk_display_pointer_is_grabbed
- Date: Mon, 3 Oct 2011 12:25:33 +0000 (UTC)
commit 1edd94a9502e7733c70ee6336e45dcd9c8e38563
Author: Adel Gadllah <adel gadllah gmail com>
Date: Sun Oct 2 09:52:16 2011 +0200
gdk: Plug leak in gdk_display_pointer_is_grabbed
gdk_x11_device_manager_core_list_devices returns a new allocated
list, which has to be freed.
valgrind output:
==18686== 160,176 (80,088 direct, 80,088 indirect) bytes in 3,337 blocks are definitely lost in loss record 25,347 of 25,378
==18686== at 0x4C256DD: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==18686== by 0x6CD7752: g_malloc (in /lib64/libglib-2.0.so.0.3000.0)
==18686== by 0x6CEE2B6: g_slice_alloc (in /lib64/libglib-2.0.so.0.3000.0)
==18686== by 0x6CCB37D: g_list_prepend (in /lib64/libglib-2.0.so.0.3000.0)
==18686== by 0x654CADA: gdk_x11_device_manager_core_list_devices (gdkdevicemanager-core-x11.c:836)
==18686== by 0x6531489: gdk_display_pointer_is_grabbed (gdkdisplay.c:1270)
==18686== by 0x5162E1E: filter_func (ui.c:140)
==18686== by 0x6558B50: gdk_event_apply_filters (gdkeventsource.c:83)
==18686== by 0x6558CB3: _gdk_x11_display_queue_events (gdkeventsource.c:197)
==18686== by 0x6530680: gdk_display_get_event (gdkdisplay.c:311)
==18686== by 0x65589F1: gdk_event_source_dispatch (gdkeventsource.c:356)
==18686== by 0x6CD0A0E: g_main_context_dispatch (in /lib64/libglib-2.0.so.0.3000.0)
https://bugzilla.gnome.org/show_bug.cgi?id=660676
gdk/gdkdisplay.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/gdk/gdkdisplay.c b/gdk/gdkdisplay.c
index cdfc356..bf50c84 100644
--- a/gdk/gdkdisplay.c
+++ b/gdk/gdkdisplay.c
@@ -1275,9 +1275,14 @@ gdk_display_pointer_is_grabbed (GdkDisplay *display)
if (gdk_device_get_source (device) == GDK_SOURCE_MOUSE &&
gdk_display_device_is_grabbed (display, device))
- return TRUE;
+ {
+ g_list_free (devices);
+ return TRUE;
+ }
}
+ g_list_free (devices);
+
return FALSE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]