From 70af52d74c3f4253791120be4016f108aa966b4d Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Sun, 13 Feb 2011 16:28:06 -0500 Subject: 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. --- sleekxmpp/xmlstream/handler/callback.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sleekxmpp/xmlstream/handler') diff --git a/sleekxmpp/xmlstream/handler/callback.py b/sleekxmpp/xmlstream/handler/callback.py index f0a72853..cfd3c43c 100644 --- a/sleekxmpp/xmlstream/handler/callback.py +++ b/sleekxmpp/xmlstream/handler/callback.py @@ -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) -- cgit v1.2.3