mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Revert: update theOnlyProject field after project dispose because otherwise "projectDisposed" listeners from the other project might get the wrong project
This commit is contained in:
@@ -3,6 +3,7 @@ package com.intellij.openapi.project.impl;
|
||||
|
||||
import com.intellij.openapi.components.ComponentConfig;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.project.ProjectManager;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -50,5 +51,6 @@ final class DefaultProject extends ProjectImpl {
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("Disposed DefaultProject "+this);
|
||||
}
|
||||
((ProjectManagerImpl)ProjectManager.getInstance()).updateTheOnlyProjectField();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,6 @@ import com.intellij.openapi.progress.ProgressIndicatorProvider;
|
||||
import com.intellij.openapi.progress.ProgressManager;
|
||||
import com.intellij.openapi.project.DumbAwareRunnable;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.project.ProjectManager;
|
||||
import com.intellij.openapi.project.ex.ProjectEx;
|
||||
import com.intellij.openapi.project.ex.ProjectManagerEx;
|
||||
import com.intellij.openapi.startup.StartupManager;
|
||||
@@ -348,8 +347,6 @@ public class ProjectImpl extends PlatformComponentManagerImpl implements Project
|
||||
if (!application.isDisposed()) {
|
||||
application.getMessageBus().syncPublisher(ProjectLifecycleListener.TOPIC).afterProjectClosed(this);
|
||||
}
|
||||
((ProjectManagerImpl)ProjectManager.getInstance()).updateTheOnlyProjectField();
|
||||
|
||||
TimedReference.disposeTimed();
|
||||
LaterInvocator.purgeExpiredItems();
|
||||
}
|
||||
|
||||
@@ -459,6 +459,7 @@ public class ProjectManagerImpl extends ProjectManagerEx implements Disposable {
|
||||
private void removeFromOpened(@NotNull Project project) {
|
||||
synchronized (lock) {
|
||||
myOpenProjects = ArrayUtil.remove(myOpenProjects, project);
|
||||
updateTheOnlyProjectField();
|
||||
myOpenProjectByHash.values().remove(project); // remove by value and not by key!
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user