[gtk+/gtk-2-24] gdkwindow: Fix event unref iteration
- From: Christophe Fergeau <teuf src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-2-24] gdkwindow: Fix event unref iteration
- Date: Tue, 3 Mar 2015 16:26:32 +0000 (UTC)
commit 22eb70adab72a5c14f063ea15f8195087ff1dcd8
Author: Colin Walters <walters verbum org>
Date: Fri Dec 17 15:36:51 2010 -0500
gdkwindow: Fix event unref iteration
We were double looping previously which caused a NULL deref.
(cherry picked from commit d08ff485f28f23427bff1b3aac64ab3f77a8664d)
gdk/gdkwindow.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index fa52f04..a0500ce 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -1956,11 +1956,15 @@ _gdk_event_filter_unref (GdkWindow *window,
filters = &private->filters;
}
- for (tmp_list = *filters; tmp_list; tmp_list = tmp_list->next)
+ tmp_list = *filters;
+ while (tmp_list)
{
GdkEventFilter *iter_filter = tmp_list->data;
GList *node;
+ node = tmp_list;
+ tmp_list = tmp_list->next;
+
if (iter_filter != filter)
continue;
@@ -1970,9 +1974,6 @@ _gdk_event_filter_unref (GdkWindow *window,
if (filter->ref_count != 0)
continue;
- node = tmp_list;
- tmp_list = tmp_list->next;
-
*filters = g_list_remove_link (*filters, node);
g_free (filter);
g_list_free_1 (node);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]