From: Jim Procter Date: Wed, 7 Feb 2018 16:47:26 +0000 (+0000) Subject: JAL-2902 thread off dialog close op to avoid deadlock on the main swing thread. X-Git-Tag: Release_2_10_4~68^2~30 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=f8eadd61b07375a6aada36b2b4b2aa8c3423510e;p=jalview.git JAL-2902 thread off dialog close op to avoid deadlock on the main swing thread. --- diff --git a/src/jalview/gui/StructureChooser.java b/src/jalview/gui/StructureChooser.java index 5de3082..198aa62 100644 --- a/src/jalview/gui/StructureChooser.java +++ b/src/jalview/gui/StructureChooser.java @@ -55,6 +55,7 @@ import javax.swing.JCheckBox; import javax.swing.JComboBox; import javax.swing.JLabel; import javax.swing.JTable; +import javax.swing.SwingUtilities; import javax.swing.table.AbstractTableModel; /** @@ -911,8 +912,15 @@ public class StructureChooser extends GStructureChooser new SequenceI[] { selectedSequence }); } - closeAction(preferredHeight); - mainFrame.dispose(); + SwingUtilities.invokeLater(new Runnable() + { + @Override + public void run() + { + closeAction(preferredHeight); + mainFrame.dispose(); + } + }); } }; Thread runner = new Thread(viewStruc);