diff options
author | patthoyts <patthoyts@users.sourceforge.net> | 2009-02-27 22:59:30 (GMT) |
---|---|---|
committer | patthoyts <patthoyts@users.sourceforge.net> | 2009-02-27 22:59:30 (GMT) |
commit | a072beb6c3788ba0416b47a505dddd7b73744535 (patch) | |
tree | 1b90e7279daa7800c2331ab6b2f939914cf68866 | |
parent | 22aeecc3e7f01548116fdf9166c8865a1aa2f523 (diff) | |
download | tk-a072beb6c3788ba0416b47a505dddd7b73744535.zip tk-a072beb6c3788ba0416b47a505dddd7b73744535.tar.gz tk-a072beb6c3788ba0416b47a505dddd7b73744535.tar.bz2 |
[Bug 2645457] check for dead windows after calling Tk_MakeWindowExist to avoid a crash when mapping dead windows.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | generic/tkWindow.c | 9 |
2 files changed, 13 insertions, 1 deletions
@@ -1,3 +1,8 @@ +2009-02-27 Pat Thoyts <patthoyts@users.sourceforge.net> + + * generic/tkWindow.c: [Bug 2645457] check for dead windows after + calling Tk_MakeWindowExist to avoid a crash when mapping dead windows. + 2009-02-23 Pat Thoyts <patthoyts@users.sourceforge.net> * win/tkWinCursor.c: [Patch 2542828] use stock Win32 help arrow diff --git a/generic/tkWindow.c b/generic/tkWindow.c index 406eb7a..161cdcb 100644 --- a/generic/tkWindow.c +++ b/generic/tkWindow.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: tkWindow.c,v 1.89.2.2 2008/04/07 23:14:07 hobbs Exp $ + * RCS: @(#) $Id: tkWindow.c,v 1.89.2.3 2009/02/27 22:59:30 patthoyts Exp $ */ #include "tkInt.h" @@ -1640,6 +1640,13 @@ Tk_MapWindow( if (winPtr->window == None) { Tk_MakeWindowExist(tkwin); } + /* + * [Bug 2645457]: the previous call permits events to be processed and can + * lead to the destruction of the window under some conditions. + */ + if (winPtr->flags & TK_ALREADY_DEAD) { + return; + } if (winPtr->flags & TK_WIN_MANAGED) { /* * Lots of special processing has to be done for top-level windows. |