From: James Procter Date: Wed, 15 Nov 2023 14:54:31 +0000 (+0000) Subject: JAL-4090 blocker patch JAL-3772 tidy up groovy console when closed rather than callin... X-Git-Tag: Release_2_11_3_0^2~1^2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=72a9ef4b4e3763c857ef095eadc8c656ccb441ff;hp=-c;p=jalview.git JAL-4090 blocker patch JAL-3772 tidy up groovy console when closed rather than calling its exit and hanging --- 72a9ef4b4e3763c857ef095eadc8c656ccb441ff 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)