From 2d679f1f9a26cb044c7bdd72fa74098a02826eef Mon Sep 17 00:00:00 2001 From: daneren2005 Date: Thu, 22 May 2014 10:24:39 -0700 Subject: Move checkDownloads out of finally block Possible fix for multiple downloads running when switching current playing song --- src/github/daneren2005/dsub/service/DownloadFile.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/github/daneren2005/dsub/service/DownloadFile.java b/src/github/daneren2005/dsub/service/DownloadFile.java index e59e6f12..4af85975 100644 --- a/src/github/daneren2005/dsub/service/DownloadFile.java +++ b/src/github/daneren2005/dsub/service/DownloadFile.java @@ -468,11 +468,14 @@ public class DownloadFile implements BufferFile { if (wifiLock != null) { wifiLock.release(); } - new CacheCleaner(context, DownloadService.getInstance()).cleanSpace(); - if(DownloadService.getInstance() != null) { - DownloadService.getInstance().checkDownloads(); - } - } + } + + // Only run these if not interrupted, ie: cancelled + new CacheCleaner(context, DownloadService.getInstance()).cleanSpace(); + + if(DownloadService.getInstance() != null) { + DownloadService.getInstance().checkDownloads(); + } return null; } -- cgit v1.2.3