Skip to content

Commit 35c77e4

Browse files
committed
Remove Stanza once callback called to avoid memory ballonning
Deleting session._expected[ID] when the callback will be processed avoid this dict to grow over the time.
1 parent 96eff7d commit 35c77e4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

xmpp/dispatcher.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,7 @@ def dispatch(self,stanza,session=None,direct=0):
289289
user=0
290290
if type(session._expected[ID])==type(()):
291291
cb,args=session._expected[ID]
292+
del session._expected[ID]
292293
session.DEBUG("Expected stanza arrived. Callback %s(%s) found!"%(cb,args),'ok')
293294
try: cb(session,stanza,**args)
294295
except Exception, typ:

0 commit comments

Comments
 (0)