JAL-629 remove structure viewer from the list of structure viewer base instances...
authorJames Procter <j.procter@dundee.ac.uk>
Tue, 5 Sep 2023 16:03:42 +0000 (17:03 +0100)
committerJames Procter <j.procter@dundee.ac.uk>
Tue, 5 Sep 2023 16:03:42 +0000 (17:03 +0100)
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();
   }