changeset 4047:560cdfdfffc3

Fix leaking open edit-log files, refactor cleanup code in request.finish
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 30 Aug 2008 16:09:30 +0200
parents 6d9652a1db90
children eb9ee3746030
files MoinMoin/request/__init__.py
diffstat 1 files changed, 15 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/request/__init__.py	Tue Aug 26 17:37:26 2008 +0200
+++ b/MoinMoin/request/__init__.py	Sat Aug 30 16:09:30 2008 +0200
@@ -1618,12 +1618,21 @@
         # only execute finishers once
         self._finishers = []
 
-        try:
-            #del self.user    # keeping this is useful for testing
-            del self.theme
-            del self.dicts
-        except:
-            pass
+        for attr_name in [
+            'editlog', # avoid leaking file handles for open edit-log
+            'theme',
+            'dicts',
+            'user',
+            'rootpage',
+            'page',
+            'html_formatter',
+            'formatter',
+            'cfg',
+            ]:
+            try:
+                delattr(self, attr_name)
+            except:
+                pass
 
     def add_finisher(self, method):
         self._finishers.append(method)