diff options
author | patthoyts@users.sourceforge.net <patthoyts> | 2009-02-28 09:42:26 (GMT) |
---|---|---|
committer | patthoyts@users.sourceforge.net <patthoyts> | 2009-02-28 09:42:26 (GMT) |
commit | f018f2ab9c60b8f0af5dfacabb179ac4beb5d08c (patch) | |
tree | e2187e768249dd4b232cb74ea634759d810dfb79 | |
parent | 97b27b9099f59dd80f0de42230117eb876791513 (diff) | |
download | tk-f018f2ab9c60b8f0af5dfacabb179ac4beb5d08c.zip tk-f018f2ab9c60b8f0af5dfacabb179ac4beb5d08c.tar.gz tk-f018f2ab9c60b8f0af5dfacabb179ac4beb5d08c.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-28 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. + 2008-02-06 Daniel Steffen <das@users.sourceforge.net> * generic/tkImgPhoto.c: fix leaks discovered with the Mac OS X diff --git a/generic/tkWindow.c b/generic/tkWindow.c index 4be22b9..69f4db6 100644 --- a/generic/tkWindow.c +++ b/generic/tkWindow.c @@ -12,7 +12,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.56.2.15 2008/04/07 23:12:10 hobbs Exp $ + * RCS: @(#) $Id: tkWindow.c,v 1.56.2.16 2009/02/28 09:42:26 patthoyts Exp $ */ #include "tkPort.h" @@ -1653,6 +1653,13 @@ Tk_MapWindow(tkwin) 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 |