diff --git a/lib/system/gc.nim b/lib/system/gc.nim index ec656e0efc..5405948ebc 100644 --- a/lib/system/gc.nim +++ b/lib/system/gc.nim @@ -575,6 +575,7 @@ proc collectCycles(gch: var TGcHeap) = d.refcount = d.refcount +% rcIncrement if d in gch.cycleRoots and not containsOrIncl(marker, d): forAllChildren(d, waPush) + Deinit(marker) # remove cycles: for c in elements(gch.cycleRoots): if c.refcount <% rcIncrement: