diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | generic/tclNamesp.c | 20 | ||||
-rw-r--r-- | tests/trace.test | 8 |
3 files changed, 19 insertions, 14 deletions
@@ -1,3 +1,8 @@ +2005-10-31 Miguel Sofer <msofer@users.sf.net> + + * generic/tclNamesp.c: fix for [Bugs 1338280/1337229]. Thanks Don. + * tests/trace.test: fix duplicate test numbers + 2005-10-31 Donal K. Fellows <donal.k.fellows@manchester.ac.uk> * win/tclWinSerial.c (SerialSetOptionProc): Cleaned up option parsing diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c index 2acedcb..456f335 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.84 2005/09/14 18:35:56 dgp Exp $ + * RCS: @(#) $Id: tclNamesp.c,v 1.85 2005/10/31 19:54:56 msofer Exp $ */ #include "tclInt.h" @@ -1019,15 +1019,6 @@ 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! - * TclDeleteVars frees it, so we reinitialize it afterwards. - */ - - TclDeleteVars(iPtr, &nsPtr->varTable); - 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. @@ -1058,6 +1049,15 @@ 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. */ diff --git a/tests/trace.test b/tests/trace.test index 93894bf..224f698 100644 --- a/tests/trace.test +++ b/tests/trace.test @@ -11,7 +11,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: trace.test,v 1.41 2005/10/29 19:16:32 msofer Exp $ +# RCS: @(#) $Id: trace.test,v 1.42 2005/10/31 19:54:56 msofer Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest @@ -1179,7 +1179,7 @@ test trace-18.4 {namespace delete / trace vdelete combo, Bug \#1338280} { namespace delete ::ref rename doTrace {} set info -} 1110 +} 1010 # Delete arrays when done, so they can be re-used as scalars # elsewhere. @@ -1187,12 +1187,12 @@ test trace-18.4 {namespace delete / trace vdelete combo, Bug \#1338280} { catch {unset x} catch {unset y} -test trace-18.3 {trace add command (command existence)} { +test trace-19.0.1 {trace add command (command existence)} { # Just in case! catch {rename nosuchname ""} list [catch {trace add command nosuchname rename traceCommand} msg] $msg } {1 {unknown command "nosuchname"}} -test trace-18.4 {trace add command (command existence in ns)} { +test trace-19.0.2 {trace add command (command existence in ns)} { list [catch {trace add command nosuchns::nosuchname rename traceCommand} msg] $msg } {1 {unknown command "nosuchns::nosuchname"}} |