From bd3274989cacc2be56b4f9e5dd006adb3be96637 Mon Sep 17 00:00:00 2001 From: James Procter Date: Tue, 5 Sep 2023 17:03:42 +0100 Subject: [PATCH] JAL-629 remove structure viewer from the list of structure viewer base instances when its closeViewer method is called --- src/jalview/gui/StructureViewerBase.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/jalview/gui/StructureViewerBase.java b/src/jalview/gui/StructureViewerBase.java index ff615c8..ed42ffa 100644 --- a/src/jalview/gui/StructureViewerBase.java +++ b/src/jalview/gui/StructureViewerBase.java @@ -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(); } -- 1.7.10.2