/** Free all resources allocated by this object */ public void dispose() { // Close all running jobs final AppContext appContext = AppContext.getAppContext(); ExecutorService executorService = (ExecutorService) appContext.get(SwingWorker.class); if (executorService != null) { executorService.shutdown(); } // Free UI resources if (editors != null) { editors.dispose(); } if (geoCatalog != null) { geoCatalog.dispose(); } if (mainFrame != null) { mainFrame.dispose(); } if (singleFrameTracker != null) { singleFrameTracker.close(); } if (editorFactoryTracker != null) { editorFactoryTracker.close(); } if (editorTracker != null) { editorTracker.close(); } if (toolBarTracker != null) { toolBarTracker.close(); } dockManager.dispose(); loggerCollection.dispose(); // Free libraries resources mainContext.dispose(); UIFactory.setMainFrame(null); }