summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorhobbs <hobbs>2005-10-10 20:26:30 (GMT)
committerhobbs <hobbs>2005-10-10 20:26:30 (GMT)
commit9500cbcc13a4de799d51779752efd4fecdfba4ea (patch)
tree6fedc85615ccbc774fc6249540384e03c9e03a3f /generic
parent3e9b017699cf78eefcb39c0f2a2951235d3652d3 (diff)
downloadtk-9500cbcc13a4de799d51779752efd4fecdfba4ea.zip
tk-9500cbcc13a4de799d51779752efd4fecdfba4ea.tar.gz
tk-9500cbcc13a4de799d51779752efd4fecdfba4ea.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]
Diffstat (limited to 'generic')
-rw-r--r--generic/tkMenu.c12
1 files changed, 10 insertions, 2 deletions
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