summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpatthoyts <patthoyts@users.sourceforge.net>2009-02-27 23:04:39 (GMT)
committerpatthoyts <patthoyts@users.sourceforge.net>2009-02-27 23:04:39 (GMT)
commit0aa2082226c7156d97ae4a66c508d1fd6ee421c4 (patch)
tree88705f845ef5d3e16c124088085828b7e9103b68
parent4288c6d11ebb6214ee682d7924ba4fe8b44f1b44 (diff)
downloadtk-0aa2082226c7156d97ae4a66c508d1fd6ee421c4.zip
tk-0aa2082226c7156d97ae4a66c508d1fd6ee421c4.tar.gz
tk-0aa2082226c7156d97ae4a66c508d1fd6ee421c4.tar.bz2
[Bug 2645457] check for dead windows after calling Tk_MakeWindowExist to avoid a crash when mapping dead windows.
-rw-r--r--ChangeLog5
-rw-r--r--generic/tkWindow.c9
2 files changed, 13 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 43397ee..91099b0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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/rc/*.cur: [Patch 2513104] fix cursor hotspots (cjmcdonald)
diff --git a/generic/tkWindow.c b/generic/tkWindow.c
index 37b4a43..8c2d435 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.102 2008/12/28 13:08:39 dkf Exp $
+ * RCS: @(#) $Id: tkWindow.c,v 1.103 2009/02/27 23:04:39 patthoyts Exp $
*/
#include "tkInt.h"
@@ -1644,6 +1644,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.