summaryrefslogtreecommitdiffstats
path: root/generic/tclNamesp.c
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2005-11-04 02:13:40 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2005-11-04 02:13:40 (GMT)
commitf30e4208875db88eacedeabb363d94c5dbcc32ce (patch)
tree7a2c5ad8267a9ae169b566172b931957957725ef /generic/tclNamesp.c
parent1917d75e5fe50a58035bc8a2a47fdca8338ec9d7 (diff)
downloadtcl-f30e4208875db88eacedeabb363d94c5dbcc32ce.zip
tcl-f30e4208875db88eacedeabb363d94c5dbcc32ce.tar.gz
tcl-f30e4208875db88eacedeabb363d94c5dbcc32ce.tar.bz2
* generic/tclInt.h:
* generic/tclNamesp.c: * generic/tclVar.c: * tests/trace.test: fix for [Bugs 1338280/1337229]; changed to use the same approach as the 8.4 patch in the ticket (i.e., removed the patch committed on 2005-31-10).
Diffstat (limited to 'generic/tclNamesp.c')
-rw-r--r--generic/tclNamesp.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c
index 456f335..299b1ac 100644
--- a/generic/tclNamesp.c
+++ b/generic/tclNamesp.c
@@ -21,7 +21,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclNamesp.c,v 1.85 2005/10/31 19:54:56 msofer Exp $
+ * RCS: @(#) $Id: tclNamesp.c,v 1.86 2005/11/04 02:13:41 msofer Exp $
*/
#include "tclInt.h"
@@ -958,7 +958,7 @@ Tcl_DeleteNamespace(namespacePtr)
* one last time.
*/
- TclDeleteVars((Interp *) nsPtr->interp, &nsPtr->varTable);
+ TclDeleteNamespaceVars(nsPtr);
Tcl_DeleteHashTable(&nsPtr->childTable);
Tcl_DeleteHashTable(&nsPtr->cmdTable);
@@ -1019,6 +1019,15 @@ TclTeardownNamespace(nsPtr)
int i;
/*
+ * Start by destroying the namespace's variable table, since variables
+ * might trigger traces. Variable table should be cleared but not freed!
+ * TclDeleteNamespaceVars frees it, so we reinitialize it afterwards.
+ */
+
+ TclDeleteNamespaceVars(nsPtr);
+ Tcl_InitHashTable(&nsPtr->varTable, TCL_STRING_KEYS);
+
+ /*
* Delete all commands in this namespace. Be careful when traversing the
* hash table: when each command is deleted, it removes itself from the
* command table.
@@ -1049,15 +1058,6 @@ TclTeardownNamespace(nsPtr)
nsPtr->parentPtr = NULL;
/*
- * Destroy the namespace's variable table
- * Variable table should be cleared but not freed!
- * TclDeleteVars frees it, so we reinitialize it afterwards.
- */
-
- TclDeleteVars(iPtr, &nsPtr->varTable);
- Tcl_InitHashTable(&nsPtr->varTable, TCL_STRING_KEYS);
-
- /*
* Delete the namespace path if one is installed.
*/