summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhobbs <hobbs>2003-12-03 04:57:37 (GMT)
committerhobbs <hobbs>2003-12-03 04:57:37 (GMT)
commit30898442d4bd1515e66413919387389ea326bebb (patch)
tree88da1ccdc684bece5acffcf9757f20dd95186309
parent0846b3417b95766d91c1ec7aa598a89f559e018f (diff)
downloadtk-30898442d4bd1515e66413919387389ea326bebb.zip
tk-30898442d4bd1515e66413919387389ea326bebb.tar.gz
tk-30898442d4bd1515e66413919387389ea326bebb.tar.bz2
* generic/tkMenu.c (MenuVarProc): prevent this from triggering
while interp is being destroyed.
-rw-r--r--ChangeLog5
-rw-r--r--generic/tkMenu.c18
2 files changed, 18 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 9085724..a6b258f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2003-12-02 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkMenu.c (MenuVarProc): prevent this from triggering
+ while interp is being destroyed.
+
2003-11-21 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de>
*** 8.4.5 TAGGED FOR RELEASE ***
diff --git a/generic/tkMenu.c b/generic/tkMenu.c
index 3e4c54a..9055c7a 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.20.2.1 2003/07/15 13:59:06 vincentdarley Exp $
+ * RCS: @(#) $Id: tkMenu.c,v 1.20.2.2 2003/12/03 04:57:37 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);