JAL-629 remove structure viewer from the list of structure viewer base instances...
[jalview.git] / src / jalview / gui / StructureViewerBase.java
index ff615c8..ed42ffa 100644 (file)
@@ -1362,6 +1362,13 @@ public abstract class StructureViewerBase extends GStructureViewer
     // TODO: check for memory leaks where instance isn't finalised because jmb
     // holds a reference to the window
     // jmb = null;
+    
+    try {
+      svbs.remove(this);
+    } catch (Throwable t)
+    {
+      Console.info("Unexpected exception when deregistering structure viewer",t);
+    }
     dispose();
   }