fixes memory leaks concerning closures
This commit is contained in:
parent
e24305f1e1
commit
2f826b5305
1 changed files with 2 additions and 3 deletions
|
|
@ -346,11 +346,10 @@ proc canFormAcycleAux(marker: var TIntSet, typ: PType, startId: int): bool =
|
||||||
#if t.kind == tyObject and tfFinal notin t.flags:
|
#if t.kind == tyObject and tfFinal notin t.flags:
|
||||||
# # damn inheritance may introduce cycles:
|
# # damn inheritance may introduce cycles:
|
||||||
# result = true
|
# result = true
|
||||||
|
of tyProc: result = typ.callConv == ccClosure
|
||||||
else: nil
|
else: nil
|
||||||
|
|
||||||
proc canFormAcycle(typ: PType): bool =
|
proc canFormAcycle(typ: PType): bool =
|
||||||
# XXX as I expect cycles introduced by closures are very rare, we pretend
|
|
||||||
# they can't happen here.
|
|
||||||
var marker = InitIntSet()
|
var marker = InitIntSet()
|
||||||
result = canFormAcycleAux(marker, typ, typ.id)
|
result = canFormAcycleAux(marker, typ, typ.id)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue