boolean () { if (!canClose()) { LOG.info("Close cancelled"); return false; } Project project = myFrameWrapper.getProject(); myFrameWrapper.getFrame().setVisible(false); saveSession(); myEditorWindowClosing = true; try { myEditorManager.closeAllEditors(); } finally { myEditorWindowClosing = false; } LOG.info("Window closed"); ApplicationManager.getApplication().getMessageBus().syncPublisher(LightEditServiceListener.TOPIC).lightEditWindowClosed(project); if (ProjectManager.getInstance().getOpenProjects().length == 0 && WelcomeFrame.getInstance() == null) { closeAndDisposeFrame(); LOG.info("No open projects or welcome frame, exiting"); try { Disposer.dispose(myEditorManager); ApplicationManager.getApplication().exit(); } catch (Throwable t) { System.exit(1); } } else { WindowManagerEx.getInstanceEx().releaseFrame(myFrameWrapper); myFrameWrapper = null; } return false; }