summaryrefslogtreecommitdiffstats
path: root/generic/tkMenu.c
diff options
context:
space:
mode:
authorhobbs <hobbs>2003-12-03 04:58:09 (GMT)
committerhobbs <hobbs>2003-12-03 04:58:09 (GMT)
commit196efe10b0ba1a571cead6f7ec9d042815f37aca (patch)
treef7fd2f82c0d266519b8152fb01b55beb4a60ef0c /generic/tkMenu.c
parentcd184fa0a81211827cd0bdfe39ad4adac7a859fb (diff)
downloadtk-196efe10b0ba1a571cead6f7ec9d042815f37aca.zip
tk-196efe10b0ba1a571cead6f7ec9d042815f37aca.tar.gz
tk-196efe10b0ba1a571cead6f7ec9d042815f37aca.tar.bz2
* generic/tkMenu.c (MenuVarProc): prevent this from triggering
while interp is being destroyed.
Diffstat (limited to 'generic/tkMenu.c')
-rw-r--r--generic/tkMenu.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/generic/tkMenu.c b/generic/tkMenu.c
index 713a288..731f2c3 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.21 2003/05/30 11:03:00 vincentdarley Exp $
+ * RCS: @(#) $Id: tkMenu.c,v 1.22 2003/12/03 04:58:09 hobbs Exp $
*/
/*
@@ -2544,19 +2544,27 @@ MenuVarProc(clientData, interp, name1, name2, flags)
TkMenuEntry *mePtr = (TkMenuEntry *) clientData;
TkMenu *menuPtr;
CONST char *value;
- char *name = Tcl_GetStringFromObj(mePtr->namePtr, NULL);
+ char *name;
char *onValue;
+ if (flags & TCL_INTERP_DESTROYED) {
+ /*
+ * Do nothing if the interpreter is going away.
+ */
+
+ return (char *) NULL;
+ }
+
menuPtr = mePtr->menuPtr;
+ name = Tcl_GetStringFromObj(mePtr->namePtr, NULL);
/*
- * If the variable is being unset, then re-establish the
- * trace unless the whole interpreter is going away.
+ * If the variable is being unset, then re-establish the trace.
*/
if (flags & TCL_TRACE_UNSETS) {
mePtr->entryFlags &= ~ENTRY_SELECTED;
- if ((flags & TCL_TRACE_DESTROYED) && !(flags & TCL_INTERP_DESTROYED)) {
+ if ((flags & TCL_TRACE_DESTROYED) {
Tcl_TraceVar(interp, name,
TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
MenuVarProc, clientData);