summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhobbs <hobbs@noemail.net>2005-10-10 20:26:29 (GMT)
committerhobbs <hobbs@noemail.net>2005-10-10 20:26:29 (GMT)
commit7a320a500d5d925b48b0b9c49a69df967b572278 (patch)
tree6fedc85615ccbc774fc6249540384e03c9e03a3f
parent4e6401d330916c217c71f282a2edd2730587bb56 (diff)
downloadtk-7a320a500d5d925b48b0b9c49a69df967b572278.zip
tk-7a320a500d5d925b48b0b9c49a69df967b572278.tar.gz
tk-7a320a500d5d925b48b0b9c49a69df967b572278.tar.bz2
* generic/tkMenu.c (TkSetWindowMenuBar): do not call TkMenuInit if
the winPtr indicates TK_ALREADY_DEAD. This prevents reinit that creates a Tk exit handler after all exit handlers should be called. [Bug 749908, 1322294] FossilOrigin-Name: 7ad500616a12624f448e269963e83ea339d73fca
-rw-r--r--ChangeLog7
-rw-r--r--generic/tkMenu.c12
2 files changed, 17 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 3fdf85a..4c60f50 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2005-10-10 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkMenu.c (TkSetWindowMenuBar): do not call TkMenuInit if
+ the winPtr indicates TK_ALREADY_DEAD. This prevents reinit that
+ creates a Tk exit handler after all exit handlers should be
+ called. [Bug 749908, 1322294]
+
2005-10-10 Vince Darley <vincentdarley@users.sourceforge.net>
* doc/text.n
diff --git a/generic/tkMenu.c b/generic/tkMenu.c
index 549fa75..2c4f2a5 100644
--- a/generic/tkMenu.c
+++ b/generic/tkMenu.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: tkMenu.c,v 1.28 2005/10/10 19:28:27 hobbs Exp $
+ * RCS: @(#) $Id: tkMenu.c,v 1.29 2005/10/10 20:26:31 hobbs Exp $
*/
/*
@@ -3118,11 +3118,19 @@ TkSetWindowMenuBar(interp, tkwin, oldMenuName, menuName)
* toplevel needs to be set to. NULL means
* that their is no menu now. */
{
+ TkWindow *winPtr = (TkWindow *)tkwin;
TkMenuTopLevelList *topLevelListPtr, *prevTopLevelPtr;
TkMenu *menuPtr;
TkMenuReferences *menuRefPtr;
- TkMenuInit();
+ /*
+ * Avoid reinitialization if we are just cleaning up dead windows.
+ * Perhaps knowing when Tcl was really exiting would be better than
+ * just checking for this winPtr being dead. [Bug 749908]
+ */
+ if (!(winPtr->flags & TK_ALREADY_DEAD)) {
+ TkMenuInit();
+ }
/*
* Destroy the menubar instances of the old menu. Take this window