void () { getThreadingSupport().removeReadActionListener(this); getThreadingSupport().removeWriteActionListener(this); //noinspection deprecation myDispatcher.getMulticaster().applicationExiting(); super.dispose(); // Remove IW lock from EDT as EDT might be re-created, which might lead to deadlock if anybody uses this disposed app if (!StartupUtil.isImplicitReadOnEDTDisabled() || isUnitTestMode()) { invokeLater(() -> releaseWriteIntentLock(), ModalityState.nonModal()); } // FileBasedIndexImpl can schedule some more activities to execute, so, shutdown executor only after service disposing AppExecutorUtil.shutdownApplicationScheduledExecutorService(); if (myLastDisposable == null) { ApplicationManager.setApplication(null); } else { Disposer.dispose(myLastDisposable); } otelMonitor.get().close(); }