From 56b4e3ad91a0dda632ba6bab7139665a3da163d3 Mon Sep 17 00:00:00 2001 From: Araq Date: Mon, 16 Jul 2012 08:43:54 +0200 Subject: closures shouldn't leak anymore --- compiler/ccgtrav.nim | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'compiler') diff --git a/compiler/ccgtrav.nim b/compiler/ccgtrav.nim index 75357ff46..1ff6346f6 100644 --- a/compiler/ccgtrav.nim +++ b/compiler/ccgtrav.nim @@ -80,8 +80,10 @@ proc genTraverseProc(c: var TTraversalClosure, accessor: PRope, typ: PType) = genTraverseProc(c, ropef("$1.Field$2", accessor, i.toRope), typ.sons[i]) of tyRef, tyString, tySequence: lineCg(p, cpsStmts, c.visitorFrmt, accessor) - else: - # no marker procs for closures yet + of tyProc: + if typ.callConv == ccClosure: + lineCg(p, cpsStmts, c.visitorFrmt, ropef("$1.ClEnv", accessor)) + else: nil proc genTraverseProcSeq(c: var TTraversalClosure, accessor: PRope, typ: PType) = -- cgit 1.4.1-2-gfad0