From b8152b29e8b7274eef62f3252dfe8f2cce8adb8a Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Tue, 10 Dec 2019 16:44:54 +0100 Subject: ARC: yet another bugfix (#12871) --- tests/destructor/tarc.nim | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests/destructor') diff --git a/tests/destructor/tarc.nim b/tests/destructor/tarc.nim index 5c78605d2..25921ffd7 100644 --- a/tests/destructor/tarc.nim +++ b/tests/destructor/tarc.nim @@ -82,6 +82,16 @@ proc inheritanceBug(param: string) = s[0] = B(more: "a" & param) s[1] = B(more: "a" & param) + +type + PAsyncHttpServer = ref object + value: string + +proc serve(server: PAsyncHttpServer) = discard + +proc leakObjConstr = + serve(PAsyncHttpServer(value: "asdas")) + let startMem = getOccupiedMem() take3() tlazyList() @@ -89,4 +99,5 @@ inheritanceBug("whatever") mkManyLeaks() tsimpleClosureIterator() tleakingNewStmt() +leakObjConstr() echo getOccupiedMem() - startMem -- cgit 1.4.1-2-gfad0