summaryrefslogtreecommitdiff
path: root/sleekxmpp/xmlstream/xmlstream.py
diff options
context:
space:
mode:
Diffstat (limited to 'sleekxmpp/xmlstream/xmlstream.py')
-rw-r--r--sleekxmpp/xmlstream/xmlstream.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/sleekxmpp/xmlstream/xmlstream.py b/sleekxmpp/xmlstream/xmlstream.py
index 0a66a974..8abbb3a1 100644
--- a/sleekxmpp/xmlstream/xmlstream.py
+++ b/sleekxmpp/xmlstream/xmlstream.py
@@ -19,6 +19,7 @@ import threading
import time
import types
import random
+import weakref
try:
import queue
except ImportError:
@@ -719,7 +720,7 @@ class XMLStream(object):
"""
if handler.stream is None:
self.__handlers.append(handler)
- handler.stream = self
+ handler.stream = weakref.ref(self)
def remove_handler(self, name):
"""