JAL-4199 Restore deletable test when removing workers
authorMateusz Warowny <mmzwarowny@dundee.ac.uk>
Wed, 12 Jul 2023 13:49:12 +0000 (15:49 +0200)
committerMateusz Warowny <mmzwarowny@dundee.ac.uk>
Wed, 12 Jul 2023 14:25:05 +0000 (16:25 +0200)
src/jalview/workers/AlignCalcManager2.java
src/jalview/ws2/actions/annotation/AlignCalcWorkerAdapter.java

index 582c84f..39111ae 100644 (file)
@@ -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
index cf693bc..0905ea2 100644 (file)
@@ -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();