From 6272b90a851a6d5225cdc32da0fefc59f1e4d91b Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Fri, 28 Sep 2012 20:53:52 -0700 Subject: Fixed concurrency issue with downloadRecursive --- .../src/github/daneren2005/dsub/service/DownloadServiceImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'subsonic-android/src') diff --git a/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java b/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java index a2d63b5c..cf3e9556 100644 --- a/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java +++ b/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java @@ -912,10 +912,12 @@ public class DownloadServiceImpl extends Service implements DownloadService { } while (i != start); if((preloaded + 1 == n || preloaded >= Util.getPreloadCount(this)) && !backgroundDownloadList.isEmpty()) { - for(DownloadFile downloadFile : backgroundDownloadList) { + for(i = 0; i < backgroundDownloadList.size(); i++) { + DownloadFile downloadFile = backgroundDownloadList.get(i); if(downloadFile.isWorkDone()) { // Don't need to keep list like active song list backgroundDownloadList.remove(downloadFile); + i--; } else { currentDownloading = downloadFile; currentDownloading.download(); -- cgit v1.2.3