don't invoke destructors for .global. variables
This commit is contained in:
parent
61a43979e6
commit
d16c04d8f8
2 changed files with 4 additions and 2 deletions
|
|
@ -1078,7 +1078,8 @@ proc insertDestructors(c: PContext, varSection: PNode):
|
|||
varTyp = varId.sym.typ
|
||||
info = varId.info
|
||||
|
||||
if varTyp != nil and instantiateDestructor(c, varTyp):
|
||||
if varTyp != nil and instantiateDestructor(c, varTyp) and
|
||||
sfGlobal notin varId.sym.flags:
|
||||
var tryStmt = newNodeI(nkTryStmt, info)
|
||||
|
||||
if j < totalVars - 1:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue