diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2019-06-20 07:40:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-20 07:40:45 +0200 |
commit | c65a5d754b791dfad72420fa27cfe933c6a7782c (patch) | |
tree | b146a231876a8351ba586912ee867c121ac6218c /lib/core | |
parent | 1a074fffa421b6cab0357e86d1011cc39eafcc61 (diff) | |
download | Nim-c65a5d754b791dfad72420fa27cfe933c6a7782c.tar.gz |
[bugfix] owned closures (#11544)
Diffstat (limited to 'lib/core')
-rw-r--r-- | lib/core/runtime_v2.nim | 7 |
1 files changed, 7 insertions, 0 deletions
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.} = |