From 3d6fb9b21d41728a56e56b53901b080815805265 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Sun, 23 Aug 2015 10:20:29 +0200 Subject: [PATCH] remove callbacks directly from iterator --- src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java index 9063cca4..ae11a3bf 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java +++ b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java @@ -750,13 +750,13 @@ public class XmppConnection implements Runnable { while (iterator.hasNext()) { Pair entry = iterator.next(); callbacks.add(entry.second); + iterator.remove(); } - this.packetCallbacks.clear(); } for(OnIqPacketReceived callback : callbacks) { callback.onIqPacketReceived(account,failurePacket); } - Log.d(Config.LOGTAG,account.getJid().toBareJid()+": done clearing iq callbacks"); + Log.d(Config.LOGTAG,account.getJid().toBareJid()+": done clearing iq callbacks. "+this.packetCallbacks.size()+" left"); } private void sendStartSession() {