From 26bee9c9d99659a369aa481e67357f2322e7feed Mon Sep 17 00:00:00 2001 From: Sam Bosley Date: Wed, 4 Jan 2012 16:24:43 -0800 Subject: [PATCH] Hopefully fixed a concurrent modification crash in sync service --- .../com/todoroo/astrid/actfm/sync/ActFmSyncService.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmSyncService.java b/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmSyncService.java index 7f9e03e3d..b4633a47f 100644 --- a/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmSyncService.java +++ b/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmSyncService.java @@ -195,8 +195,10 @@ public final class ActFmSyncService { } if(failedPushes.size() > 0) { // Copy into a second queue so we don't end up infinitely retrying in the same loop - Queue toTry = new LinkedList(failedPushes); - failedPushes.clear(); + Queue toTry = new LinkedList(); + while (failedPushes.size() > 0) { + toTry.add(failedPushes.remove(0)); + } while(!toTry.isEmpty() && !actFmPreferenceService.isOngoing()) { FailedPush pushOp = toTry.remove(); switch(pushOp.pushType) {