gc:destructors: sink parameters need to be destroyed properly
This commit is contained in:
parent
7e404c670d
commit
c025786b75
1 changed files with 3 additions and 3 deletions
|
|
@ -632,7 +632,7 @@ proc injectDestructorCalls*(g: ModuleGraph; owner: PSym; n: PNode): PNode =
|
||||||
let params = owner.typ.n
|
let params = owner.typ.n
|
||||||
for i in 1 ..< params.len:
|
for i in 1 ..< params.len:
|
||||||
let param = params[i].sym
|
let param = params[i].sym
|
||||||
if param.typ.kind == tySink and hasDestructor(param.typ):
|
if param.typ.kind == tySink and hasDestructor(param.typ.sons[0]):
|
||||||
c.destroys.add genDestroy(c, param.typ.skipTypes({tyGenericInst, tyAlias, tySink}), params[i])
|
c.destroys.add genDestroy(c, param.typ.skipTypes({tyGenericInst, tyAlias, tySink}), params[i])
|
||||||
|
|
||||||
let body = p(n, c)
|
let body = p(n, c)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue