JAL-4195 catch thrown exceptions (if any) during image export and report as an error.
[jalview.git] / src / jalview / gui / Desktop.java
index 6f2faae..1fcc591 100644 (file)
@@ -3571,4 +3571,17 @@ public class Desktop extends jalview.jbgui.GDesktop
       jalview.bin.Console.debug(Cache.getStackTraceString(e));
     }
   }
+
+  /**
+   * closes the current instance window, disposes and forgets about it.
+   */
+  public static void closeDesktop()
+  {
+    if (Desktop.instance != null) {
+      Desktop.instance.closeAll_actionPerformed(null);
+      Desktop.instance.setVisible(false);
+      Desktop.instance.dispose();
+      Desktop.instance = null;
+    }
+  }
 }