mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
the right fix for one-time listener removal
This commit is contained in:
@@ -67,12 +67,15 @@ public class FileBasedIndexProjectHandler extends AbstractProjectComponent imple
|
||||
rootManager.registerRefreshUpdater(changedFilesUpdater);
|
||||
myIndex.registerIndexableSet(FileBasedIndexProjectHandler.this, project);
|
||||
projectManager.addProjectManagerListener(project, new ProjectManagerAdapter() {
|
||||
private boolean removed = false;
|
||||
@Override
|
||||
public void projectClosing(Project project) {
|
||||
projectManager.removeProjectManagerListener(this);
|
||||
rootManager.unregisterRefreshUpdater(changedFilesUpdater);
|
||||
rootManager.unregisterRootsChangeUpdater(unindexedFilesUpdater);
|
||||
myIndex.removeIndexableSet(FileBasedIndexProjectHandler.this);
|
||||
if (!removed) {
|
||||
removed = true;
|
||||
rootManager.unregisterRefreshUpdater(changedFilesUpdater);
|
||||
rootManager.unregisterRootsChangeUpdater(unindexedFilesUpdater);
|
||||
myIndex.removeIndexableSet(FileBasedIndexProjectHandler.this);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user