[bugfix] owned closures (#11544)
This commit is contained in:
parent
1a074fffa4
commit
c65a5d754b
11 changed files with 102 additions and 30 deletions
|
|
@ -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.} =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue