diff options
author | dgp <dgp@users.sourceforge.net> | 2016-09-07 18:09:30 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2016-09-07 18:09:30 (GMT) |
commit | 35141afcc9ca65b400d055d491a343b74b133e15 (patch) | |
tree | ee41ace108164ac84cf9846a9512b9b7290abcd3 /tests/var.test | |
parent | 4ef0c69aaadaecd18748067dce66645646fcbd88 (diff) | |
parent | 6053836b9780c7e74540700e2e2ea602b6c30101 (diff) | |
download | tcl-35141afcc9ca65b400d055d491a343b74b133e15.zip tcl-35141afcc9ca65b400d055d491a343b74b133e15.tar.gz tcl-35141afcc9ca65b400d055d491a343b74b133e15.tar.bz2 |
[4dbdd9af14] Plug mem leak when var unset trace re-creates namespace var. Thanks mr_calvin for report and fix.
Diffstat (limited to 'tests/var.test')
-rw-r--r-- | tests/var.test | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/var.test b/tests/var.test index 44e671a..9816d98 100644 --- a/tests/var.test +++ b/tests/var.test @@ -594,6 +594,22 @@ test var-8.2 {TclDeleteNamespaceVars, "unset" traces on ns delete are called wit list [namespace delete test_ns_var] $::info } -result {{} {::test_ns_var::v {} u}} +test var-8.3 {TclDeleteNamespaceVars, mem leak} -constraints memory -setup { + proc ::t {a i o} { + set $a 321 + } +} -body { + leaktest { + namespace eval n { + variable v 123 + trace variable v u ::t + } + namespace delete n + } +} -cleanup { + rename ::t {} +} -result 0 + test var-9.1 {behaviour of TclGet/SetVar simple get/set} -setup { catch {unset u} catch {unset v} |