From 264fe1353379ffc6e90dee9d107b15f30da40737 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Wed, 7 Feb 2018 16:48:22 +0000 Subject: [PATCH] =?utf8?q?JAL-2902=20catch=20case=20where=20viewer=20is=20cl?= =?utf8?q?osed=20(therefore=20binding=20is=20null)=20before=20hasMapping=20i?= =?utf8?q?s=20called.=20technically,=20hasMapping=20should=20return=20false=E2?= =?utf8?q?=80=A6=20but=20not=20if=20it=20is=20being=20used=20to=20poll.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/jalview/gui/StructureViewerBase.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/jalview/gui/StructureViewerBase.java b/src/jalview/gui/StructureViewerBase.java index 891e771..93d675a 100644 --- a/src/jalview/gui/StructureViewerBase.java +++ b/src/jalview/gui/StructureViewerBase.java @@ -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(); -- 1.7.10.2