From d7dbe16f76a17f582d7819378bac121fab061316 Mon Sep 17 00:00:00 2001 From: jprocter Date: Fri, 18 Feb 2011 17:16:39 +0000 Subject: [PATCH] call to release any explicit event handler references and fix for occasional arrayIndexOutOfboundsErrors --- src/jalview/structure/StructureSelectionManager.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/jalview/structure/StructureSelectionManager.java b/src/jalview/structure/StructureSelectionManager.java index 0e4ec2f..492907b 100644 --- a/src/jalview/structure/StructureSelectionManager.java +++ b/src/jalview/structure/StructureSelectionManager.java @@ -215,7 +215,7 @@ public class StructureSelectionManager // allocate enough slots to store the mapping from positions in // sequence[s] to the associated chain - int[][] mapping = new int[maxChain.sequence.getEnd() + 2][2]; + int[][] mapping = new int[sequence[s].findPosition(sequence[s].getLength()) + 2][2]; int resNum = -10000; int index = 0; @@ -259,6 +259,17 @@ public class StructureSelectionManager public void removeStructureViewerListener(Object svl, String[] pdbfiles) { listeners.removeElement(svl); + if (svl instanceof SequenceListener) + { + for (int i=0;i