Commit ea786056 authored by Vincent Pelletier's avatar Vincent Pelletier

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

This fixes a memory leak in dispatcher.queue_dict.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@1829 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 7f885a83
......@@ -77,6 +77,11 @@ class ThreadContext(object):
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 @@ class ThreadContext(object):
'object_stored': 0,
'txn_voted': False,
'txn_finished': False,
'queue': Queue(0),
'queue': queue,
'txn_info': 0,
'history': None,
'node_tids': {},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment