From c65a5d754b791dfad72420fa27cfe933c6a7782c Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Thu, 20 Jun 2019 07:40:45 +0200 Subject: [bugfix] owned closures (#11544) --- lib/core/runtime_v2.nim | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib') diff --git a/lib/core/runtime_v2.nim b/lib/core/runtime_v2.nim index 0165833b4..5689e3072 100644 --- a/lib/core/runtime_v2.nim +++ b/lib/core/runtime_v2.nim @@ -78,6 +78,13 @@ proc nimRawDispose(p: pointer) {.compilerRtl.} = proc nimDestroyAndDispose(p: pointer) {.compilerRtl.} = let d = cast[ptr PNimType](p)[].destructor if d != nil: cast[DestructorProc](d)(p) + when false: + cstderr.rawWrite cast[ptr PNimType](p)[].name + cstderr.rawWrite "\n" + if d == nil: + cstderr.rawWrite "bah, nil\n" + else: + cstderr.rawWrite "has destructor!\n" nimRawDispose(p) proc isObj(obj: PNimType, subclass: cstring): bool {.compilerproc.} = -- cgit 1.4.1-2-gfad0