JAL-2068 deleting user-defined annotation removes the worker
[jalview.git] / src / jalview / workers / ColumnCounterWorker.java
index 6f4a4f3..69f4265 100644 (file)
@@ -103,7 +103,7 @@ class ColumnCounterWorker extends AlignCalcWorker
     } catch (OutOfMemoryError error)
     {
       ap.raiseOOMWarning("calculating feature counts", error);
-      calcMan.workerCannotRun(this);
+      calcMan.disableWorker(this);
     } finally
     {
       calcMan.workerComplete(this);
@@ -222,4 +222,15 @@ class ColumnCounterWorker extends AlignCalcWorker
   {
     // do nothing
   }
+
+  /**
+   * Answers true to indicate that if this worker's annotation is deleted from
+   * the display, the worker should also be removed. This prevents it running
+   * and recreating the annotation when the alignment changes.
+   */
+  @Override
+  public boolean isDeletable()
+  {
+    return true;
+  }
 }