From 788adb3977209d98934788e18f330ec1549b596b Mon Sep 17 00:00:00 2001 From: Mateusz Warowny Date: Wed, 12 Jul 2023 15:49:12 +0200 Subject: [PATCH] JAL-4199 Restore deletable test when removing workers --- src/jalview/workers/AlignCalcManager2.java | 5 ++++- src/jalview/ws2/actions/annotation/AlignCalcWorkerAdapter.java | 6 ++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/jalview/workers/AlignCalcManager2.java b/src/jalview/workers/AlignCalcManager2.java index 582c84f..39111ae 100644 --- a/src/jalview/workers/AlignCalcManager2.java +++ b/src/jalview/workers/AlignCalcManager2.java @@ -302,7 +302,10 @@ public class AlignCalcManager2 implements AlignCalcManagerI2 @Override public void removeWorker(AlignCalcWorkerI worker) { - registered.remove(worker); + if (worker.isDeletable()) + { + registered.remove(worker); + } } @Override diff --git a/src/jalview/ws2/actions/annotation/AlignCalcWorkerAdapter.java b/src/jalview/ws2/actions/annotation/AlignCalcWorkerAdapter.java index cf693bc..0905ea2 100644 --- a/src/jalview/ws2/actions/annotation/AlignCalcWorkerAdapter.java +++ b/src/jalview/ws2/actions/annotation/AlignCalcWorkerAdapter.java @@ -148,6 +148,12 @@ public class AlignCalcWorkerAdapter extends AlignCalcWorker implements PollableA } @Override + public boolean isDeletable() + { + return true; + } + + @Override public String toString() { return "AlignCalcWorkerAdapter-" + calcNumber + " for " + getCalcName(); -- 1.7.10.2