From 2234cd245c480a4706e28dc183a2e9a31b4e559e Mon Sep 17 00:00:00 2001 From: mdipierro Date: Mon, 3 Jun 2013 22:12:05 -0500 Subject: [PATCH] fixed memory leak in issue 1493 --- VERSION | 2 +- gluon/html.py | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/VERSION b/VERSION index 617bfef3..088ab459 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.4.7-stable+timestamp.2013.06.03.21.48.08 +Version 2.4.7-stable+timestamp.2013.06.03.22.11.22 diff --git a/gluon/html.py b/gluon/html.py index 53462c12..54326155 100644 --- a/gluon/html.py +++ b/gluon/html.py @@ -1198,6 +1198,13 @@ def TAG_pickler(data): return (TAG_unpickler, (marshal_dump,)) +class __tag__(DIV): + def __init__(self,name,*a,**b): + DIV.__init__(self,*a,**b) + self.tag = name + +copy_reg.pickle(__tag__, TAG_pickler, TAG_unpickler) + class __TAG__(XmlComponent): """ @@ -1216,11 +1223,7 @@ class __TAG__(XmlComponent): name = name[:-1] + '/' if isinstance(name, unicode): name = name.encode('utf-8') - - class __tag__(DIV): - tag = name - copy_reg.pickle(__tag__, TAG_pickler, TAG_unpickler) - return lambda *a, **b: __tag__(*a, **b) + return lambda *a,**b: __tag__(name,*a,**b) def __call__(self, html): return web2pyHTMLParser(decoder.decoder(html)).tree