mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
do not create default project on app dispose
To avoid exceptions on exit like: java.lang.RuntimeException: Memory leak detected: 'com.intellij.openapi.vfs.encoding.EncodingManagerImpl@695b8c2c' of class com.intellij.openapi.vfs.encoding.EncodingManagerImpl See the cause for the corresponding Disposer.register() stacktrace:
This commit is contained in:
@@ -331,6 +331,7 @@ public class ProjectManagerImpl extends ProjectManagerEx implements Disposable {
|
||||
public synchronized Project getDefaultProject() {
|
||||
LOG.assertTrue(!myDefaultProjectWasDisposed, "Default project has been already disposed!");
|
||||
if (myDefaultProject == null) {
|
||||
LOG.assertTrue(!ApplicationManager.getApplication().isDisposeInProgress(), "Application being disposed!");
|
||||
ProgressManager.getInstance().executeNonCancelableSection(() -> {
|
||||
try {
|
||||
myDefaultProject = createProject(null, "", true);
|
||||
|
||||
+1
@@ -759,6 +759,7 @@ public class FlatWelcomeFrame extends JFrame implements IdeFrame, Disposable, Ac
|
||||
@Nullable
|
||||
@Override
|
||||
public Project getProject() {
|
||||
if (ApplicationManager.getApplication().isDisposeInProgress()) return null;
|
||||
return ProjectManager.getInstance().getDefaultProject();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user