Make one-off Callbacks ready for deletion after the prerun step.

Waiting until the actual run step means that the handler is not
marked for deletion when checked in the __spawn_event() thread,
causing the callback to stay in the handler list.
This commit is contained in:
Lance Stout 2011-02-13 16:28:06 -05:00
parent ca2b4a188a
commit 70af52d74c

View file

@ -62,6 +62,8 @@ class Callback(BaseHandler):
payload -- The matched stanza object.
"""
BaseHandler.prerun(self, payload)
if self._once:
self._destroy = True
if self._instream:
self.run(payload, True)