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

This commit is contained in:
Andreas Rumpf 2019-11-15 12:38:11 +01:00 • committed by GitHub
commit 76179cbec2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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