mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEADEV-40960: IDEA locks up when project configuration dialog is closed
This commit is contained in:
+13
-4
@@ -25,7 +25,7 @@ public class ProjectStructureDaemonAnalyzer implements Disposable {
|
||||
private Set<ProjectStructureElement> myElementWithNotCalculatedUsages = new HashSet<ProjectStructureElement>();
|
||||
private MergingUpdateQueue myAnalyzerQueue;
|
||||
private List<Runnable> myListeners = new ArrayList<Runnable>();
|
||||
private boolean myDisposed;
|
||||
private boolean myStopped;
|
||||
|
||||
public ProjectStructureDaemonAnalyzer(StructureConfigurableContext context) {
|
||||
Disposer.register(context, this);
|
||||
@@ -33,7 +33,7 @@ public class ProjectStructureDaemonAnalyzer implements Disposable {
|
||||
}
|
||||
|
||||
private void doUpdate(final ProjectStructureElement element, final boolean check, final boolean collectUsages) {
|
||||
if (myDisposed) return;
|
||||
if (myStopped) return;
|
||||
|
||||
if (check) {
|
||||
doCheck(element);
|
||||
@@ -47,6 +47,8 @@ public class ProjectStructureDaemonAnalyzer implements Disposable {
|
||||
final ProjectStructureProblemsHolder problemsHolder = new ProjectStructureProblemsHolder();
|
||||
new ReadAction() {
|
||||
protected void run(final Result result) {
|
||||
if (myStopped) return;
|
||||
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("checking " + element);
|
||||
}
|
||||
@@ -55,6 +57,8 @@ public class ProjectStructureDaemonAnalyzer implements Disposable {
|
||||
}.execute();
|
||||
invokeLater(new Runnable() {
|
||||
public void run() {
|
||||
if (myStopped) return;
|
||||
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("updating problems for " + element);
|
||||
}
|
||||
@@ -74,6 +78,8 @@ public class ProjectStructureDaemonAnalyzer implements Disposable {
|
||||
private void doCollectUsages(final ProjectStructureElement element) {
|
||||
final List<ProjectStructureElementUsage> usages = new ReadAction<List<ProjectStructureElementUsage>>() {
|
||||
protected void run(final Result<List<ProjectStructureElementUsage>> result) {
|
||||
if (myStopped) return;
|
||||
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("collecting usages in " + element);
|
||||
}
|
||||
@@ -83,6 +89,8 @@ public class ProjectStructureDaemonAnalyzer implements Disposable {
|
||||
|
||||
invokeLater(new Runnable() {
|
||||
public void run() {
|
||||
if (myStopped) return;
|
||||
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("updating usages for " + element);
|
||||
}
|
||||
@@ -158,6 +166,7 @@ public class ProjectStructureDaemonAnalyzer implements Disposable {
|
||||
|
||||
public void stop() {
|
||||
LOG.debug("analyzer stopped");
|
||||
myStopped = true;
|
||||
myAnalyzerQueue.cancelAllUpdates();
|
||||
clearCaches();
|
||||
myAnalyzerQueue.deactivate();
|
||||
@@ -174,7 +183,7 @@ public class ProjectStructureDaemonAnalyzer implements Disposable {
|
||||
}
|
||||
|
||||
public void dispose() {
|
||||
myDisposed = true;
|
||||
myStopped = true;
|
||||
myAnalyzerQueue.cancelAllUpdates();
|
||||
}
|
||||
|
||||
@@ -202,7 +211,7 @@ public class ProjectStructureDaemonAnalyzer implements Disposable {
|
||||
myAnalyzerQueue.activate();
|
||||
myAnalyzerQueue.queue(new Update("reset") {
|
||||
public void run() {
|
||||
myDisposed = false;
|
||||
myStopped = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user