ARC: fixes leaking new() statement (#12665)

This commit is contained in:
Andreas Rumpf
2019-11-15 12:38:11 +01:00
committed by GitHub
parent 107b40f097
commit 76179cbec2
3 changed files with 24 additions and 8 deletions

View File

@@ -43,9 +43,18 @@ proc tlazyList =
var x = LazyList(c: proc () = echo(dep))
x.c()
type
Foo = ref object
proc tleakingNewStmt =
var x: Foo
for i in 0..10:
new(x)
let startMem = getOccupiedMem()
tlazyList()
mkManyLeaks()
tsimpleClosureIterator()
tleakingNewStmt()
echo getOccupiedMem() - startMem