[Neo-report] r1829 vincent - /trunk/neo/client/app.py

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Feb 23 13:30:34 CET 2010


Author: vincent
Date: Tue Feb 23 13:30:29 2010
New Revision: 1829

Log:
Don't create a new queue each time ThreadContext.clear is called.

This fixes a memory leak in dispatcher.queue_dict.

Modified:
    trunk/neo/client/app.py

Modified: trunk/neo/client/app.py
==============================================================================
--- trunk/neo/client/app.py [iso-8859-1] (original)
+++ trunk/neo/client/app.py [iso-8859-1] Tue Feb 23 13:30:29 2010
@@ -77,6 +77,11 @@
     def clear(self, thread_id=None):
         if thread_id is None:
             thread_id = get_ident()
+        thread_dict = self._threads_dict.get(thread_id)
+        if thread_dict is None:
+            queue = Queue(0)
+        else:
+            queue = thread_dict['queue']
         self._threads_dict[thread_id] = {
             'tid': None,
             'txn': None,
@@ -87,7 +92,7 @@
             'object_stored': 0,
             'txn_voted': False,
             'txn_finished': False,
-            'queue': Queue(0),
+            'queue': queue,
             'txn_info': 0,
             'history': None,
             'node_tids': {},





More information about the Neo-report mailing list