Commit 8651971e authored by Nicolas Dumazet's avatar Nicolas Dumazet

move block into lock: if several threads fiddle with erp5.accessor_holder

at the same time, we could lose with some AttributeErrors


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@41744 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent bda69450
......@@ -400,14 +400,14 @@ def synchronizeDynamicModules(context, force=False):
for class_name, klass in inspect.getmembers(erp5.portal_type,
inspect.isclass):
klass.restoreGhostState()
# Clear accessor holders of ZODB Property Sheets
for property_sheet_id in erp5.accessor_holder.__dict__.keys():
if not property_sheet_id.startswith('__'):
delattr(erp5.accessor_holder, property_sheet_id)
finally:
Base.aq_method_lock.release()
# Clear accessor holders of ZODB Property Sheets
for property_sheet_id in erp5.accessor_holder.__dict__.keys():
if not property_sheet_id.startswith('__'):
delattr(erp5.accessor_holder, property_sheet_id)
# Necessary because accessors are wrapped in WorkflowMethod by
# _aq_dynamic (performed in createAccessorHolder)
_aq_reset()
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