summaryrefslogtreecommitdiffstats
path: root/generic/tclNamesp.c
diff options
context:
space:
mode:
authordgp <dgp@noemail.net>2005-07-26 16:20:37 (GMT)
committerdgp <dgp@noemail.net>2005-07-26 16:20:37 (GMT)
commit8d7c2493a1e70c7a12088aca7fcccad2aa2601b0 (patch)
tree4c004405c8a4638d67de2e4b109c2657501d020f /generic/tclNamesp.c
parent021b1a9ce0e23cf642c616d4e4a3b10ddabe775b (diff)
downloadtcl-8d7c2493a1e70c7a12088aca7fcccad2aa2601b0.zip
tcl-8d7c2493a1e70c7a12088aca7fcccad2aa2601b0.tar.gz
tcl-8d7c2493a1e70c7a12088aca7fcccad2aa2601b0.tar.bz2
* generic/tclNamesp.c (TclTeardownNamespace): Re-ordering so that
* tests/trace.test (trace-34.4): command delete traces fire while the command still exists. [Bug 1047286] FossilOrigin-Name: 98ddae5f7cbaca457cf1757a6a723a1ebe601213
Diffstat (limited to 'generic/tclNamesp.c')
-rw-r--r--generic/tclNamesp.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c
index 3eb1bb2..1f72076 100644
--- a/generic/tclNamesp.c
+++ b/generic/tclNamesp.c
@@ -19,7 +19,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.31.2.7 2005/07/05 17:27:08 dgp Exp $
+ * RCS: @(#) $Id: tclNamesp.c,v 1.31.2.8 2005/07/26 16:20:44 dgp Exp $
*/
#include "tclInt.h"
@@ -737,6 +737,21 @@ TclTeardownNamespace(nsPtr)
}
/*
+ * 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.
+ */
+
+ for (entryPtr = Tcl_FirstHashEntry(&nsPtr->cmdTable, &search);
+ entryPtr != NULL;
+ entryPtr = Tcl_FirstHashEntry(&nsPtr->cmdTable, &search)) {
+ cmd = (Tcl_Command) Tcl_GetHashValue(entryPtr);
+ Tcl_DeleteCommandFromToken((Tcl_Interp *) iPtr, cmd);
+ }
+ Tcl_DeleteHashTable(&nsPtr->cmdTable);
+ Tcl_InitHashTable(&nsPtr->cmdTable, TCL_STRING_KEYS);
+
+ /*
* Remove the namespace from its parent's child hashtable.
*/
@@ -766,21 +781,6 @@ TclTeardownNamespace(nsPtr)
}
/*
- * 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.
- */
-
- for (entryPtr = Tcl_FirstHashEntry(&nsPtr->cmdTable, &search);
- entryPtr != NULL;
- entryPtr = Tcl_FirstHashEntry(&nsPtr->cmdTable, &search)) {
- cmd = (Tcl_Command) Tcl_GetHashValue(entryPtr);
- Tcl_DeleteCommandFromToken((Tcl_Interp *) iPtr, cmd);
- }
- Tcl_DeleteHashTable(&nsPtr->cmdTable);
- Tcl_InitHashTable(&nsPtr->cmdTable, TCL_STRING_KEYS);
-
- /*
* Free the namespace's export pattern array.
*/