diff options
author | hobbs <hobbs> | 2002-03-29 22:47:22 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2002-03-29 22:47:22 (GMT) |
commit | 37dc17ce8795fe95d137e14cf17316113b429172 (patch) | |
tree | 58c51d53f08ee0cb8c4e2465c872b6e7fbec6892 /tests | |
parent | 8cfe12eab52b71b04979c815dab4c907f74ba20c (diff) | |
download | tcl-37dc17ce8795fe95d137e14cf17316113b429172.zip tcl-37dc17ce8795fe95d137e14cf17316113b429172.tar.gz tcl-37dc17ce8795fe95d137e14cf17316113b429172.tar.bz2 |
* generic/tclCmdMZ.c (Tcl_TraceObjCmd, TraceVarProc)
(TraceCommandProc, TclTraceCommandObjCmd): corrected
potential double-free of traces on variables by flagging in
Trace*Proc that it will free the var in case the eval wants to
delete the var trace as well. [Bug #536937]
Also converted Tcl_UntraceVar -> Tcl_UntraceVar2 and Tcl_Eval to
Tcl_EvalEx in Trace*Proc for slight efficiency improvement.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/trace.test | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/trace.test b/tests/trace.test index 6a5cc88..81aa82e 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.16 2001/12/07 13:55:59 msofer Exp $ +# RCS: @(#) $Id: trace.test,v 1.17 2002/03/29 22:47:22 hobbs Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest @@ -1145,6 +1145,17 @@ test trace-18.1 {unset traces on procedure returns} { p1 foo bar set info } {0 {a x y}} +test trace-18.2 {namespace delete / trace vdelete combo} { + namespace eval ::foo { + variable x 123 + } + proc p1 args { + trace vdelete ::foo::x u p1 + } + trace variable ::foo::x u p1 + namespace delete ::foo + info exists ::foo::x +} 0 # Delete arrays when done, so they can be re-used as scalars # elsewhere. |