Fixed ConcurrentModificationException in performAutoCleanup

This commit is contained in:
daniel oeh 2013-08-20 19:04:31 +02:00
parent f9874dde93
commit eeec2d846f
1 changed files with 3 additions and 2 deletions

View File

@ -406,10 +406,11 @@ public final class DBTasks {
private static int performAutoCleanup(final Context context,
final int episodeNumber) {
List<FeedItem> candidates = DBReader.getDownloadedItems(context);
List<FeedItem> candidates = new ArrayList<FeedItem>();
List<FeedItem> downloadedItems = DBReader.getDownloadedItems(context);
List<FeedItem> queue = DBReader.getQueue(context);
List<FeedItem> delete;
for (FeedItem item : candidates) {
for (FeedItem item : downloadedItems) {
if (item.hasMedia() && item.getMedia().isDownloaded()
&& !queue.contains(item) && item.isRead()) {
candidates.add(item);