aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2014-06-24 21:27:41 -0700
committerScott Jackson <daneren2005@gmail.com>2014-06-24 21:27:41 -0700
commitab2378e631c185546f2ca713438829d49c8916f4 (patch)
tree7ecf1e768a149f866b394b223e7e475271a77a6b
parentbd8b2cf5de825c6b4b629b58f677b61654e71ede (diff)
downloaddsub-ab2378e631c185546f2ca713438829d49c8916f4.tar.gz
dsub-ab2378e631c185546f2ca713438829d49c8916f4.tar.bz2
dsub-ab2378e631c185546f2ca713438829d49c8916f4.zip
Revert, no change
-rw-r--r--src/github/daneren2005/dsub/util/BackgroundTask.java7
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) {