When ExitCommand is called to quit, it calls Application.instance().close() which calls System.exit(0). The windows of the application are not closed cleanly.
Solution :
Change close() in Application:
Change close() in WindowManager:Code:public void close() { if (windowManager.close()) System.exit(0); }
Change close() in ApplicationWindow:Code:public boolean close() { List t = (List)((ArrayList)windows).clone(); Iterator e = t.iterator(); while (e.hasNext()) { ApplicationWindow window = (ApplicationWindow)e.next(); if (!window.close()) return false; } if (subManagers != null) { e = subManagers.iterator(); while (e.hasNext()) { WindowManager wm = (WindowManager)e.next(); if (!wm.close()) return false; } } return true; }
Code:public boolean close() { boolean mustClose = getApplicationAdvisor().onPreWindowClose(this); if (mustClose) { control.dispose(); control = null; if (windowManager != null) { windowManager.remove(this); } windowManager = null; } return mustClose; }


Reply With Quote