mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[platform] incorrect fix reverted
This commit is contained in:
@@ -172,6 +172,10 @@ public class ApplicationImpl extends PlatformComponentManagerImpl implements App
|
||||
|
||||
myDoNotSave = isUnitTestMode || isHeadless;
|
||||
|
||||
if (myTestModeFlag) {
|
||||
registerShutdownHook();
|
||||
}
|
||||
|
||||
if (!isUnitTestMode && !isHeadless) {
|
||||
Disposer.register(this, Disposer.newDisposable(), "ui");
|
||||
|
||||
@@ -218,6 +222,26 @@ 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) {
|
||||
|
||||
Reference in New Issue
Block a user