mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
project dispose strictly under write action
This commit is contained in:
@@ -331,7 +331,7 @@ public class ProjectImpl extends ComponentManagerImpl implements ProjectEx {
|
||||
|
||||
public synchronized void dispose() {
|
||||
ApplicationEx application = ApplicationManagerEx.getApplicationEx();
|
||||
assert application.isDispatchThread();
|
||||
assert application.isWriteAccessAllowed(); // dispose must be under write action
|
||||
|
||||
// can call dispose only via com.intellij.ide.impl.ProjectUtil.closeAndDispose()
|
||||
LOG.assertTrue(ApplicationManager.getApplication().isUnitTestMode() || !ProjectManagerEx.getInstanceEx().isProjectOpened(this));
|
||||
|
||||
+6
-1
@@ -178,7 +178,12 @@ public class ProjectManagerImpl extends ProjectManagerEx implements NamedJDOMExt
|
||||
public void disposeComponent() {
|
||||
Disposer.dispose(myChangedFilesAlarm);
|
||||
if (myDefaultProject != null) {
|
||||
Disposer.dispose(myDefaultProject);
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
public void run() {
|
||||
Disposer.dispose(myDefaultProject);
|
||||
}
|
||||
});
|
||||
|
||||
myDefaultProject = null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -706,7 +706,11 @@ public abstract class LightPlatformTestCase extends UsefulTestCase implements Da
|
||||
ShutDownTracker.invokeAndWait(true, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
closeAndDeleteProject();
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
public void run() {
|
||||
closeAndDeleteProject();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -412,11 +412,16 @@ public abstract class PlatformTestCase extends UsefulTestCase implements DataPro
|
||||
private void disposeProject() {
|
||||
UIUtil.dispatchAllInvocationEvents();
|
||||
if (myProject != null) {
|
||||
Disposer.dispose(myProject);
|
||||
ProjectManagerEx projectManager = ProjectManagerEx.getInstanceEx();
|
||||
if (projectManager != null) {
|
||||
projectManager.setCurrentTestProject(null);
|
||||
}
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
public void run() {
|
||||
Disposer.dispose(myProject);
|
||||
ProjectManagerEx projectManager = ProjectManagerEx.getInstanceEx();
|
||||
if (projectManager != null) {
|
||||
projectManager.setCurrentTestProject(null);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
myProject = null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user