JAL-4217 close internal frame on the swing thread to avoid deadlock
authorJames Procter <j.procter@dundee.ac.uk>
Tue, 12 Dec 2023 15:48:32 +0000 (15:48 +0000)
committerJames Procter <j.procter@dundee.ac.uk>
Tue, 12 Dec 2023 15:48:32 +0000 (15:48 +0000)
src/jalview/gui/SplashScreen.java

index 1060d8a..465bc0d 100755 (executable)
@@ -36,6 +36,7 @@ import javax.swing.JLabel;
 import javax.swing.JLayeredPane;
 import javax.swing.JPanel;
 import javax.swing.JTextPane;
+import javax.swing.SwingUtilities;
 import javax.swing.event.HyperlinkEvent;
 import javax.swing.event.HyperlinkListener;
 
@@ -341,8 +342,20 @@ public class SplashScreen extends JPanel
     }
     try
     {
-
-      iframe.setClosed(true); // ##### implicated BLOCKED
+      final JInternalFrame frme = iframe;
+      SwingUtilities.invokeLater(new Runnable()
+      {
+        @Override
+        public void run()
+        {
+          try
+          {
+            frme.setClosed(true);
+          } catch (Exception ex)
+          {
+          }
+        }
+      });
     } catch (Exception ex)
     {
     }