Merge branch 'features/JAL-2885UniprotHttps' into releases/Release_2_10_4_Branch
[jalview.git] / src / jalview / gui / StructureViewerBase.java
index 891e771..93d675a 100644 (file)
@@ -103,9 +103,9 @@ public abstract class StructureViewerBase extends GStructureViewer
 
   protected boolean alignAddedStructures = false;
 
-  protected boolean _started = false;
+  protected volatile boolean _started = false;
 
-  protected boolean addingStructures = false;
+  protected volatile boolean addingStructures = false;
 
   protected Thread worker = null;
 
@@ -118,7 +118,7 @@ public abstract class StructureViewerBase extends GStructureViewer
    * used to determine if the final sequence/structure mapping has been
    * determined
    */
-  protected boolean seqColoursApplied = false;
+  protected volatile boolean seqColoursApplied = false;
 
   /**
    * Default constructor
@@ -1047,6 +1047,11 @@ public abstract class StructureViewerBase extends GStructureViewer
     }
     if (getBinding() == null)
     {
+      if (_aps == null || _aps.size() == 0)
+      {
+        // viewer has been closed, but we did at some point run.
+        return true;
+      }
       return false;
     }
     String[] pdbids = getBinding().getStructureFiles();