diff --git a/ChangeLog b/ChangeLog index 64fa10f42b..9d11ed4aa3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-08-19 Matthias Clasen + + * gtk/gtkmain.c (gtk_get_event_widget): Don't access + the user data on destroyed windows, since at best + it can be a stale pointer. (#313953, Robin Green) + 2005-08-19 Matthias Clasen * gtk/gtkhsv.c (paint_triangle): Avoid a buffer overrun. diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 64fa10f42b..9d11ed4aa3 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,9 @@ +2005-08-19 Matthias Clasen + + * gtk/gtkmain.c (gtk_get_event_widget): Don't access + the user data on destroyed windows, since at best + it can be a stale pointer. (#313953, Robin Green) + 2005-08-19 Matthias Clasen * gtk/gtkhsv.c (paint_triangle): Avoid a buffer overrun. diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 64fa10f42b..9d11ed4aa3 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,9 @@ +2005-08-19 Matthias Clasen + + * gtk/gtkmain.c (gtk_get_event_widget): Don't access + the user data on destroyed windows, since at best + it can be a stale pointer. (#313953, Robin Green) + 2005-08-19 Matthias Clasen * gtk/gtkhsv.c (paint_triangle): Avoid a buffer overrun. diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c index fbf975cba8..bb0eecaaeb 100644 --- a/gtk/gtkmain.c +++ b/gtk/gtkmain.c @@ -69,6 +69,8 @@ #include "gtkdebug.h" #include "gtkalias.h" +#include "gdk/gdkprivate.h" /* for GDK_WINDOW_DESTROYED */ + /* Private type definitions */ typedef struct _GtkInitFunction GtkInitFunction; @@ -2041,7 +2043,8 @@ gtk_get_event_widget (GdkEvent *event) GtkWidget *widget; widget = NULL; - if (event && event->any.window) + if (event && event->any.window && + !GDK_WINDOW_DESTROYED (event->any.window)) gdk_window_get_user_data (event->any.window, (void**) &widget); return widget;