remove callbacks directly from iterator
This commit is contained in:
parent
1688b65965
commit
3d6fb9b21d
|
@ -750,13 +750,13 @@ public class XmppConnection implements Runnable {
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
Pair<IqPacket, OnIqPacketReceived> entry = iterator.next();
|
Pair<IqPacket, OnIqPacketReceived> entry = iterator.next();
|
||||||
callbacks.add(entry.second);
|
callbacks.add(entry.second);
|
||||||
|
iterator.remove();
|
||||||
}
|
}
|
||||||
this.packetCallbacks.clear();
|
|
||||||
}
|
}
|
||||||
for(OnIqPacketReceived callback : callbacks) {
|
for(OnIqPacketReceived callback : callbacks) {
|
||||||
callback.onIqPacketReceived(account,failurePacket);
|
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() {
|
private void sendStartSession() {
|
||||||
|
|
Loading…
Reference in New Issue