diff options
-rw-r--r-- | generic/tkBind.c | 15 |
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; } |