diff options
author | Scott Jackson <daneren2005@gmail.com> | 2014-06-24 21:27:41 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2014-06-24 21:27:41 -0700 |
commit | ab2378e631c185546f2ca713438829d49c8916f4 (patch) | |
tree | 7ecf1e768a149f866b394b223e7e475271a77a6b /src/github/daneren2005 | |
parent | bd8b2cf5de825c6b4b629b58f677b61654e71ede (diff) | |
download | dsub-ab2378e631c185546f2ca713438829d49c8916f4.tar.gz dsub-ab2378e631c185546f2ca713438829d49c8916f4.tar.bz2 dsub-ab2378e631c185546f2ca713438829d49c8916f4.zip |
Revert, no change
Diffstat (limited to 'src/github/daneren2005')
-rw-r--r-- | src/github/daneren2005/dsub/util/BackgroundTask.java | 7 |
1 files changed, 5 insertions, 2 deletions
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<T> 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<T> 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) { |