aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordaneren2005 <daneren2005@gmail.com>2014-06-24 16:13:42 -0700
committerdaneren2005 <daneren2005@gmail.com>2014-06-24 16:13:42 -0700
commitb6c6ba694fdee09e3cb3eb46e9f47d4fa613bc9e (patch)
tree62882cae96efd063777f89e9952d3abb0edcc308
parent78b49438d5c30f138397a4228f08fb9012488c1e (diff)
downloaddsub-b6c6ba694fdee09e3cb3eb46e9f47d4fa613bc9e.tar.gz
dsub-b6c6ba694fdee09e3cb3eb46e9f47d4fa613bc9e.tar.bz2
dsub-b6c6ba694fdee09e3cb3eb46e9f47d4fa613bc9e.zip
Possible fix for randomly exiting all threads in pool
-rw-r--r--src/github/daneren2005/dsub/util/BackgroundTask.java5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/github/daneren2005/dsub/util/BackgroundTask.java b/src/github/daneren2005/dsub/util/BackgroundTask.java
index 4760577f..6ca8ea4c 100644
--- a/src/github/daneren2005/dsub/util/BackgroundTask.java
+++ b/src/github/daneren2005/dsub/util/BackgroundTask.java
@@ -136,11 +136,10 @@ 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() {