From evan at zope.com Wed May 7 17:01:18 2003 From: evan at zope.com (Evan Simpson) Date: Sun Aug 10 17:05:18 2008 Subject: [ZPT-CVS] CVS: Releases/Zope/lib/python/Products/PageTemplates/www - default.html:1.3 Message-ID: <200305072101.h47L1IR17119@cvs.baymountain.com> Update of /cvs-repository/Releases/Zope/lib/python/Products/PageTemplates/www In directory cvs.zope.org:/tmp/cvs-serv16993 Modified Files: default.html Log Message: Fix minor typo in default template code. === Releases/Zope/lib/python/Products/PageTemplates/www/default.html 1.2 => 1.3 === --- Releases/Zope/lib/python/Products/PageTemplates/www/default.html:1.2 Wed Jul 18 12:35:27 2001 +++ Releases/Zope/lib/python/Products/PageTemplates/www/default.html Wed May 7 17:01:17 2003 @@ -6,7 +6,7 @@

content title or id optional template id

+ tal:replace="template/title">optional template title This is Page Template template id. From shane at zope.com Wed May 14 17:55:15 2003 From: shane at zope.com (Shane Hathaway) Date: Sun Aug 10 17:05:18 2008 Subject: [ZPT-CVS] CVS: Zope/lib/python/Products/PageTemplates - TALES.py:1.38 Message-ID: <200305142155.h4ELtF605577@cvs.baymountain.com> Update of /cvs-repository/Zope/lib/python/Products/PageTemplates In directory cvs.zope.org:/tmp/cvs-serv4233 Modified Files: TALES.py Log Message: Fixed a memory leak in TALES. If an exception occurs in a repeat block, a cycle is left behind that includes a SafeMapping, and SafeMappings are not aware of GC, therefore the cycle can't be collected. Iterator is also in the cycle, however, and it does not need a strong reference to the Context object, since the Context refers to the Iterator. So Iterators now refer to Context through a weak reference. === Zope/lib/python/Products/PageTemplates/TALES.py 1.37 => 1.38 === --- Zope/lib/python/Products/PageTemplates/TALES.py:1.37 Mon Apr 7 13:38:27 2003 +++ Zope/lib/python/Products/PageTemplates/TALES.py Wed May 14 17:55:14 2003 @@ -18,6 +18,7 @@ __version__='$Revision$'[11:-2] import re, sys, ZTUtils +from weakref import ref from MultiMapping import MultiMapping from DocumentTemplate.DT_Util import ustr from GlobalTranslationService import getGlobalTranslationService @@ -63,11 +64,13 @@ def __init__(self, name, seq, context): ZTUtils.Iterator.__init__(self, seq) self.name = name - self._context = context + self._context_ref = ref(context) def next(self): if ZTUtils.Iterator.next(self): - self._context.setLocal(self.name, self.item) + context = self._context_ref() + if context is not None: + context.setLocal(self.name, self.item) return 1 return 0 From shane at zope.com Wed May 14 17:55:55 2003 From: shane at zope.com (Shane Hathaway) Date: Sun Aug 10 17:05:18 2008 Subject: [ZPT-CVS] CVS: Zope/lib/python/Products/PageTemplates - TALES.py:1.31.6.8 Message-ID: <200305142155.h4ELttT05614@cvs.baymountain.com> Update of /cvs-repository/Zope/lib/python/Products/PageTemplates In directory cvs.zope.org:/tmp/cvs-serv5597 Modified Files: Tag: Zope-2_6-branch TALES.py Log Message: Merge from HEAD. Fixed a memory leak in TALES. If an exception occurs in a repeat block, a cycle is left behind that includes a SafeMapping, and SafeMappings are not aware of GC, therefore the cycle can't be collected. Iterator is also in the cycle, however, and it does not need a strong reference to the Context object, since the Context refers to the Iterator. So Iterators now refer to Context through a weak reference. === Zope/lib/python/Products/PageTemplates/TALES.py 1.31.6.7 => 1.31.6.8 === --- Zope/lib/python/Products/PageTemplates/TALES.py:1.31.6.7 Wed Oct 9 10:37:37 2002 +++ Zope/lib/python/Products/PageTemplates/TALES.py Wed May 14 17:55:54 2003 @@ -18,6 +18,7 @@ __version__='$Revision$'[11:-2] import re, sys, ZTUtils +from weakref import ref from MultiMapping import MultiMapping from DocumentTemplate.DT_Util import ustr from GlobalTranslationService import getGlobalTranslationService @@ -63,11 +64,13 @@ def __init__(self, name, seq, context): ZTUtils.Iterator.__init__(self, seq) self.name = name - self._context = context + self._context_ref = ref(context) def next(self): if ZTUtils.Iterator.next(self): - self._context.setLocal(self.name, self.item) + context = self._context_ref() + if context is not None: + context.setLocal(self.name, self.item) return 1 return 0