Commit a6593241 authored by Vincent Pelletier's avatar Vincent Pelletier

Invoke message inside a try..finally block to make sure cleanup happens even if message fails.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@20925 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 9a6f3a46
...@@ -856,18 +856,20 @@ class ActivityTool (Folder, UniqueObject): ...@@ -856,18 +856,20 @@ class ActivityTool (Folder, UniqueObject):
old_ihotfix_context = False 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) try:
if old_ihotfix_context is not False: message(my_self)
# Restore iHotfix context finally:
id = get_ident() if old_ihotfix_context is not False:
iHotfix._the_lock.acquire() # Restore iHotfix context
try: id = get_ident()
if old_ihotfix_context is None: iHotfix._the_lock.acquire()
del iHotfix.contexts[id] try:
else: if old_ihotfix_context is None:
iHotfix.contexts[id] = old_ihotfix_context del iHotfix.contexts[id]
finally: else:
iHotfix._the_lock.release() iHotfix.contexts[id] = old_ihotfix_context
finally:
iHotfix._the_lock.release()
if logging: if logging:
LOG('Activity Tracking', INFO, 'invoked message') LOG('Activity Tracking', INFO, 'invoked message')
if my_self is not self: # We rewrapped self if my_self is not self: # We rewrapped self
......
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