summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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