Don't access the user data on destroyed windows, since at best it can be a

2005-08-19  Matthias Clasen  <mclasen@redhat.com>

	* 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)
This commit is contained in:
Matthias Clasen 2005-08-19 16:46:57 +00:00 committed by Matthias Clasen
parent e20eb8b760
commit 37ef7f0389
4 changed files with 22 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2005-08-19 Matthias Clasen <mclasen@redhat.com>
* 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 <mclasen@redhat.com>
* gtk/gtkhsv.c (paint_triangle): Avoid a buffer overrun.

View File

@ -1,3 +1,9 @@
2005-08-19 Matthias Clasen <mclasen@redhat.com>
* 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 <mclasen@redhat.com>
* gtk/gtkhsv.c (paint_triangle): Avoid a buffer overrun.

View File

@ -1,3 +1,9 @@
2005-08-19 Matthias Clasen <mclasen@redhat.com>
* 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 <mclasen@redhat.com>
* gtk/gtkhsv.c (paint_triangle): Avoid a buffer overrun.

View File

@ -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;