From ab2378e631c185546f2ca713438829d49c8916f4 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Tue, 24 Jun 2014 21:27:41 -0700 Subject: Revert, no change --- src/github/daneren2005/dsub/util/BackgroundTask.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/github/daneren2005') diff --git a/src/github/daneren2005/dsub/util/BackgroundTask.java b/src/github/daneren2005/dsub/util/BackgroundTask.java index 6ca8ea4c..63515f19 100644 --- a/src/github/daneren2005/dsub/util/BackgroundTask.java +++ b/src/github/daneren2005/dsub/util/BackgroundTask.java @@ -136,10 +136,12 @@ public abstract class BackgroundTask implements ProgressListener { public void cancel() { cancelled = true; + if(task != null) { + task.cancel(); + } + if(cancelListener != null) { cancelListener.onCancel(); - } else if(task != null) { - task.cancel(); } } public boolean isCancelled() { @@ -253,6 +255,7 @@ public abstract class BackgroundTask implements ProgressListener { Task task = queue.take(); task.execute(); } catch(InterruptedException stop) { + Log.e(TAG, "Thread died"); running = false; threads.remove(Thread.currentThread()); } catch(Throwable t) { -- cgit v1.2.3