Overview
| Artifact ID: | 0934149b03297b92ebb47e38ff940323e438edb5 |
|---|---|
| Ticket: | 1911919fffffffffffffffffffffffffffffffff
namespace delete trouble with unset variable traces |
| User & Date: | juliannoble on 2008-03-11 14:52:25 |
Changes
- assignee changed to: "dgp"
- cmimetype changed to: "text/plain"
- comment changed to:
When a trace handler command for a variable trace on an unset operation reinstalls the same unset trace - this causes trouble when the corresponding namespace is deleted. The handler is called multiple times - causing large (multi-second) delays in the script. This behaviour didn't occur in Tcl 8.5a7 or 8.4 but does occur in 8.5b1, 8.5.0 & 8.5.2.b1 namespace eval refs { } for {set i 0} {$i < 10} {incr i} { set refname ::refs::$i trace add variable $refname {read write unset} [list ::tracehandler] } proc ::tracehandler {args} { #lassign [lrange $args end-2 end] vref vidx op foreach {vref vidx op} [lrange $args end-2 end] {break} switch -- $op { write { error "write failed. This reference cannot be treated as a variable" } unset { trace add variable $vref {read write unset} [concat ::tracehandler $args] #according to man page - errors in unset traces are ignored - so this is not useful: #error "cannot unset. This reference cannot be treated as a variable" } read { error "read failed. This reference cannot be treated as a variable" } } return } puts stdout "===>[time {namespace delete ::refs}]<===" - foundin changed to: "obsolete: 8.5.2"
- is_private changed to: "0"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "juliannoble"
- subsystem changed to: "46. Traces"
- title changed to:
namespace delete trouble with unset variable traces
- type changed to: "Bug"