mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-10 15:04:59 +00:00
fixes memory leaks concerning closures
This commit is contained in:
@@ -346,11 +346,10 @@ proc canFormAcycleAux(marker: var TIntSet, typ: PType, startId: int): bool =
|
||||
#if t.kind == tyObject and tfFinal notin t.flags:
|
||||
# # damn inheritance may introduce cycles:
|
||||
# result = true
|
||||
of tyProc: result = typ.callConv == ccClosure
|
||||
else: nil
|
||||
|
||||
proc canFormAcycle(typ: PType): bool =
|
||||
# XXX as I expect cycles introduced by closures are very rare, we pretend
|
||||
# they can't happen here.
|
||||
proc canFormAcycle(typ: PType): bool =
|
||||
var marker = InitIntSet()
|
||||
result = canFormAcycleAux(marker, typ, typ.id)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user