mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
prevent FileIndexDataInitialization leak: use static class instead of lambda
GitOrigin-RevId: 604e0ae30d71262df405e93ae97beccc65317e46
This commit is contained in:
committed by
intellij-monorepo-bot
parent
6165391033
commit
34a4e1ee1e
@@ -2500,9 +2500,11 @@ public final class FileBasedIndexImpl extends FileBasedIndex {
|
||||
// 2) we dispose FileBasedIndex before PersistentFS disposing
|
||||
PersistentFSImpl fs = (PersistentFSImpl)ManagingFS.getInstance();
|
||||
FileBasedIndexImpl fileBasedIndex = (FileBasedIndexImpl)FileBasedIndex.getInstance();
|
||||
Disposable disposable = () -> fileBasedIndex.performShutdown(false);
|
||||
Disposable disposable = () -> new MyShutDownTask().run();
|
||||
ApplicationManager.getApplication().addApplicationListener(new MyApplicationListener(fileBasedIndex), disposable);
|
||||
Disposer.register(fs, disposable);
|
||||
myShutDownTask = new MyShutDownTask();
|
||||
ShutDownTracker.getInstance().registerShutdownTask(myShutDownTask);
|
||||
|
||||
initAssociatedDataForExtensions();
|
||||
|
||||
@@ -2571,8 +2573,6 @@ public final class FileBasedIndexImpl extends FileBasedIndex {
|
||||
return state;
|
||||
}
|
||||
finally {
|
||||
myShutDownTask = () -> FileBasedIndexImpl.this.performShutdown(false);
|
||||
ShutDownTracker.getInstance().registerShutdownTask(myShutDownTask);
|
||||
|
||||
myFlushingFuture = FlushingDaemon.everyFiveSeconds(new Runnable() {
|
||||
private final SerializationManagerEx mySerializationManager = SerializationManagerEx.getInstanceEx();
|
||||
@@ -2596,6 +2596,13 @@ public final class FileBasedIndexImpl extends FileBasedIndex {
|
||||
}
|
||||
}
|
||||
|
||||
private static class MyShutDownTask implements Runnable {
|
||||
@Override
|
||||
public void run() {
|
||||
((FileBasedIndexImpl)FileBasedIndex.getInstance()).performShutdown(false);
|
||||
}
|
||||
}
|
||||
|
||||
private static class MyApplicationListener implements ApplicationListener {
|
||||
private final FileBasedIndexImpl myFileBasedIndex;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user