summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordas <das>2009-08-24 00:54:42 (GMT)
committerdas <das>2009-08-24 00:54:42 (GMT)
commit5ca9bf47bc58fbe5915c7e37dc842f8cf93a4be6 (patch)
treee4972e69257f0512c9f12760dee600e51e7f4a15 /generic
parent2b61fda7660e28461b6dfe55f422c70aa390483d (diff)
downloadtk-5ca9bf47bc58fbe5915c7e37dc842f8cf93a4be6.zip
tk-5ca9bf47bc58fbe5915c7e37dc842f8cf93a4be6.tar.gz
tk-5ca9bf47bc58fbe5915c7e37dc842f8cf93a4be6.tar.bz2
* generic/tkBind.c (HandleEventGenerate): Don't generate events for
windows that don't exist yet (fixes TkAqua testsuite crash).
Diffstat (limited to 'generic')
-rw-r--r--generic/tkBind.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/generic/tkBind.c b/generic/tkBind.c
index 395fca3..c460a8c 100644
--- a/generic/tkBind.c
+++ b/generic/tkBind.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkBind.c,v 1.56 2009/08/09 21:20:33 nijtmans Exp $
+ * RCS: @(#) $Id: tkBind.c,v 1.57 2009/08/24 00:54:42 das Exp $
*/
#include "tkInt.h"
@@ -3335,7 +3335,7 @@ HandleEventGenerate(
flags = flagArray[event.general.xany.type];
if (flags & DESTROY) {
/*
- * Event DesotryNotify should be generated by destroying the window.
+ * Event DestroyNotify should be generated by destroying the window.
*/
Tk_DestroyWindow(tkwin);
@@ -3773,6 +3773,15 @@ HandleEventGenerate(
Tcl_GetString(optionPtr), "\" option", NULL);
return TCL_ERROR;
}
+
+ /*
+ * Don't generate events for windows that don't exist yet.
+ */
+
+ if (!event.general.xany.window) {
+ goto done;
+ }
+
if (userDataObj != NULL) {
/*
@@ -3812,6 +3821,8 @@ HandleEventGenerate(
dispPtr->warpX = event.general.xkey.x;
dispPtr->warpY = event.general.xkey.y;
}
+
+done:
Tcl_ResetResult(interp);
return TCL_OK;
}