From 1d3a141a3091b6ee56c4a7aa1b1555addb56f2c9 Mon Sep 17 00:00:00 2001 From: Stefan Krulj Date: Fri, 8 Mar 2013 00:08:01 +0100 Subject: [PATCH] dict-size changed-bug hopefully fixed --- sys/brathuhn.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/brathuhn.py b/sys/brathuhn.py index e05d986..1d7f3a0 100644 --- a/sys/brathuhn.py +++ b/sys/brathuhn.py @@ -15,6 +15,7 @@ group_listeners = [] private_listeners = [] status_listeners = [] call_ats = dict() +call_ats_remove = [] call_ats_id = 0 join_time = time.time()+60*60*24*365 #1 year in the future @@ -289,10 +290,10 @@ def loop(): to_remove = [] for cid in call_ats: call=call_ats[cid] - if time.time()>=call[1]: + if time.time()>=call[1] and call not in call_ats_remove: call[0](*call[2]) to_remove.append(cid) - for cid in to_remove: + for cid in to_remove + call_ats_remove: del call_ats[cid] except xmpp.protocol.Conflict: @@ -336,7 +337,7 @@ def cancelCall(cid): @param cid -- The id of the call to remove """ if cid in call_ats: - del call_ats[cid] + call_ats_remove.append( call_ats[cid] ) def sendFile(to,path,method=SI): """Send a file using method specified