arc: do not unload globals when building a library [backport:1.2] (#14180)

This commit is contained in:
Andreas Rumpf 2020-05-01 09:15:46 +02:00 • committed by GitHub
commit d5fc35c968
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2019,8 +2019,9 @@ proc myClose(graph: ModuleGraph; b: PPassContext, n: PNode): PNode =
if m.config.exc == excGoto and getCompilerProc(graph, "nimTestErrorFlag") != nil:
discard cgsym(m, "nimTestErrorFlag")
for i in countdown(high(graph.globalDestructors), 0):
n.add graph.globalDestructors[i]
if {optGenStaticLib, optGenDynLib} * m.config.globalOptions == {}:
for i in countdown(high(graph.globalDestructors), 0):
n.add graph.globalDestructors[i]
if passes.skipCodegen(m.config, n): return
if moduleHasChanged(graph, m.module):
# if the module is cached, we don't regenerate the main proc