summaryrefslogtreecommitdiff
path: root/sleekxmpp/xmlstream/handler
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2011-02-13 16:28:06 -0500
committerLance Stout <lancestout@gmail.com>2011-02-13 16:28:06 -0500
commit70af52d74c3f4253791120be4016f108aa966b4d (patch)
tree89d354b18fab86b916698037a9d68878ed9e00db /sleekxmpp/xmlstream/handler
parentca2b4a188ac31d1bdf45ec244c950f7675414b38 (diff)
downloadslixmpp-70af52d74c3f4253791120be4016f108aa966b4d.tar.gz
slixmpp-70af52d74c3f4253791120be4016f108aa966b4d.tar.bz2
slixmpp-70af52d74c3f4253791120be4016f108aa966b4d.tar.xz
slixmpp-70af52d74c3f4253791120be4016f108aa966b4d.zip
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.
Diffstat (limited to 'sleekxmpp/xmlstream/handler')
-rw-r--r--sleekxmpp/xmlstream/handler/callback.py2
1 files changed, 2 insertions, 0 deletions
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)