JAL-2902 thread off dialog close op to avoid deadlock on the main swing thread.
authorJim Procter <jprocter@issues.jalview.org>
Wed, 7 Feb 2018 16:47:26 +0000 (16:47 +0000)
committerJim Procter <jprocter@issues.jalview.org>
Wed, 7 Feb 2018 16:47:26 +0000 (16:47 +0000)
src/jalview/gui/StructureChooser.java

index 5de3082..198aa62 100644 (file)
@@ -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);