Commit 2f1d6180737 by Pierre-Yves David

transaction: allow finalizer to add finalizer

It will make some code (persistent nodemap related) simpler to write, because
higher level code can blindly queue finalization without thinking too hard about
the context.

Differential Revision:
parent e598c874b4a
......@@ -506,9 +506,12 @@ class transaction(util.transactional):
self._validator(self) # will raise exception if needed
self._validator = None # Help prevent cycles.
categories = sorted(self._finalizecallback)
for cat in categories:
while self._finalizecallback:
callbacks = self._finalizecallback
self._finalizecallback = {}
categories = sorted(callbacks)
for cat in categories:
# Prevent double usage and help clear cycles.
self._finalizecallback = None
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