Skip to content

Commit

Permalink
fix memory leak when excecute BEMRender.render() with entrypoint argu…
Browse files Browse the repository at this point in the history
…ment
  • Loading branch information
generalov committed Jan 18, 2013
1 parent 1a5514b commit d19192d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions pybem/pybem.py
Expand Up @@ -124,10 +124,12 @@ def render(self, pagedir, context, env, entrypoint,
ctx.locals.context = context
ctx.locals.env = env
if entrypoint:
ctx.locals.bemjson = ctx.eval('%s(context, env)' % entrypoint)
if return_bemjson:
return ctx.eval('JSON.stringify(%s(context, env))' % entrypoint)
return ctx.eval('BEMHTML.apply(%s(context, env))' % entrypoint)
else:
ctx.locals.bemjson = context
if return_bemjson:
return ctx.eval('JSON.stringify(bemjson)')
return ctx.eval('BEMHTML.apply(bemjson)')
if return_bemjson:
return ctx.eval('JSON.stringify(bemjson)')
return ctx.eval('BEMHTML.apply(bemjson)')

0 comments on commit d19192d

Please sign in to comment.