[platform] drops unnecessary test mode shutdown hook (IDEA-155918)

This commit is contained in:
Roman Shevchenko
2016-05-12 16:06:52 +02:00
parent 8fd03f4731
commit f9d82631b1
@@ -172,10 +172,6 @@ public class ApplicationImpl extends PlatformComponentManagerImpl implements App
myDoNotSave = isUnitTestMode || isHeadless;
if (myTestModeFlag) {
registerShutdownHook();
}
if (!isUnitTestMode && !isHeadless) {
Disposer.register(this, Disposer.newDisposable(), "ui");
@@ -222,26 +218,6 @@ public class ApplicationImpl extends PlatformComponentManagerImpl implements App
myLock = new ReadMostlyRWLock(edt);
}
private void registerShutdownHook() {
ShutDownTracker.getInstance().registerShutdownTask(() -> {
if (isDisposed() || myDisposeInProgress) {
return;
}
ShutDownTracker.invokeAndWait(isUnitTestMode(), true, () -> {
if (ApplicationManager.getApplication() != this) return;
try {
myDisposeInProgress = true;
saveAll();
}
finally {
if (!disposeSelf(true)) {
myDisposeInProgress = false;
}
}
});
});
}
private boolean disposeSelf(final boolean checkCanCloseProject) {
final ProjectManagerImpl manager = (ProjectManagerImpl)ProjectManagerEx.getInstanceEx();
if (manager != null) {