diff options
author | Scott Jackson <daneren2005@gmail.com> | 2012-09-28 20:53:52 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2012-09-28 20:53:52 -0700 |
commit | 6272b90a851a6d5225cdc32da0fefc59f1e4d91b (patch) | |
tree | ddc408886bfb1aac41635611e99447250a3058bd /subsonic-android/src/github | |
parent | 681584458f9aecf230544d6fbec6e3a3f5167cb2 (diff) | |
download | dsub-6272b90a851a6d5225cdc32da0fefc59f1e4d91b.tar.gz dsub-6272b90a851a6d5225cdc32da0fefc59f1e4d91b.tar.bz2 dsub-6272b90a851a6d5225cdc32da0fefc59f1e4d91b.zip |
Fixed concurrency issue with downloadRecursive
Diffstat (limited to 'subsonic-android/src/github')
-rw-r--r-- | subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java | 4 |
1 files changed, 3 insertions, 1 deletions
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(); |