Commit 5f8d6207 authored by Vincent Pelletier's avatar Vincent Pelletier

Improve iHotfix cleanup code to distinguish between a non-need to cleanup and...

Improve iHotfix cleanup code to distinguish between a non-need to cleanup and a need to remove iHotfix context.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@20923 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2c693d69
...@@ -853,15 +853,18 @@ class ActivityTool (Folder, UniqueObject): ...@@ -853,15 +853,18 @@ class ActivityTool (Folder, UniqueObject):
for item in base_chain: for item in base_chain:
my_self = item.__of__(my_self) my_self = item.__of__(my_self)
else: else:
old_ihotfix_context = None old_ihotfix_context = False
my_self = self my_self = self
LOG('CMFActivity.ActivityTool.invoke', INFO, 'Strange: invoke is called outside of acquisition context.') LOG('CMFActivity.ActivityTool.invoke', INFO, 'Strange: invoke is called outside of acquisition context.')
message(my_self) message(my_self)
if old_ihotfix_context is not None: if old_ihotfix_context is not False:
# Restore iHotfix context # Restore iHotfix context
id = get_ident() id = get_ident()
iHotfix._the_lock.acquire() iHotfix._the_lock.acquire()
try: try:
if old_ihotfix_context is None:
del iHotfix.contexts[id]
else:
iHotfix.contexts[id] = old_ihotfix_context iHotfix.contexts[id] = old_ihotfix_context
finally: finally:
iHotfix._the_lock.release() iHotfix._the_lock.release()
......
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