diff options
| author | dkf <donal.k.fellows@manchester.ac.uk> | 2014-07-18 22:05:16 (GMT) |
|---|---|---|
| committer | dkf <donal.k.fellows@manchester.ac.uk> | 2014-07-18 22:05:16 (GMT) |
| commit | 4e4b5a7e5395eb6d333aa2cfd17172507cd4d82b (patch) | |
| tree | b0062290c77cc2a04a544ce224cd35faa7d50799 | |
| parent | 6cd3ffa2465b9f50cbb6baeab7cc2b8b072e680d (diff) | |
| download | tcl-4e4b5a7e5395eb6d333aa2cfd17172507cd4d82b.zip tcl-4e4b5a7e5395eb6d333aa2cfd17172507cd4d82b.tar.gz tcl-4e4b5a7e5395eb6d333aa2cfd17172507cd4d82b.tar.bz2 | |
[75b8433707] Plug a subtle memory leak in TclOO.
Test suite very unhappy with this. Shoving into
a mistake branch until that's sorted.
| -rw-r--r-- | generic/tclOO.c | 1 | ||||
| -rw-r--r-- | tests/oo.test | 13 |
2 files changed, 14 insertions, 0 deletions
diff --git a/generic/tclOO.c b/generic/tclOO.c index de00733..74de6d0 100644 --- a/generic/tclOO.c +++ b/generic/tclOO.c @@ -1280,6 +1280,7 @@ TclOORemoveFromInstances( removeInstance: if (Deleted(clsPtr->thisPtr)) { + DelRef(clsPtr->instances.list[i]); clsPtr->instances.list[i] = NULL; } else { clsPtr->instances.num--; diff --git a/tests/oo.test b/tests/oo.test index d63e931..fcd9818 100644 --- a/tests/oo.test +++ b/tests/oo.test @@ -258,6 +258,19 @@ test oo-1.18 {OO: create object in NS with same name as global cmd} -setup { rename test-oo-1.18 {} A destroy } -result ::C +test oo-1.18.1 {Bug 75b8433707: memory leak in oo-1.18} -setup { + proc test-oo-1.18 {} return +} -constraints memory -body { + leaktest { + oo::class create A + oo::class create B {superclass A} + oo::define B constructor {} {A create test-oo-1.18} + B create C + A destroy + } +} -cleanup { + rename test-oo-1.18 {} +} -result 0 test oo-1.19 {basic test of OO functionality: teardown order} -body { oo::object create o namespace delete [info object namespace o] |
