From 72a9ef4b4e3763c857ef095eadc8c656ccb441ff Mon Sep 17 00:00:00 2001 From: James Procter Date: Wed, 15 Nov 2023 14:54:31 +0000 Subject: [PATCH] JAL-4090 blocker patch JAL-3772 tidy up groovy console when closed rather than calling its exit and hanging --- src/jalview/gui/Desktop.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/jalview/gui/Desktop.java b/src/jalview/gui/Desktop.java index a2a344c..35c7818 100644 --- a/src/jalview/gui/Desktop.java +++ b/src/jalview/gui/Desktop.java @@ -1518,7 +1518,21 @@ public class Desktop extends jalview.jbgui.GDesktop { // suppress a possible repeat prompt to save script groovyConsole.setDirty(false); - groovyConsole.exit(); + + // and tidy up + if (((Window) groovyConsole.getFrame()) != null + && ((Window) groovyConsole.getFrame()).isVisible()) + { + // console is visible -- FIXME JAL-4327 + groovyConsole.exit(); + } + else + { + // console is not, so just let it dispose itself when we shutdown + // we don't call groovyConsole.exit() because it calls the shutdown + // handler with invokeAndWait() causing deadlock + groovyConsole = null; + } } if (terminateJvm) -- 1.7.10.2