mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
shared-indexes: fix plugin unloading leak, cleanup dispose of SerializationManagerImpl, IDEA-247481
GitOrigin-RevId: 2668a3015b3c0b0759be8c9adef5791558d93441
This commit is contained in:
committed by
intellij-monorepo-bot
parent
4459904153
commit
2ada13db18
@@ -55,7 +55,7 @@ public final class SerializationManagerImpl extends SerializationManagerEx imple
|
||||
nameStorageCrashed();
|
||||
}
|
||||
finally {
|
||||
ShutDownTracker.getInstance().registerShutdownTask(this::performShutdown);
|
||||
ShutDownTracker.getInstance().registerShutdownTask(this::performShutdown, this);
|
||||
}
|
||||
|
||||
StubElementTypeHolderEP.EP_NAME.addChangeListener(this::dropSerializerData, this);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.openapi.util;
|
||||
|
||||
import com.intellij.openapi.Disposable;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -104,6 +105,11 @@ public final class ShutDownTracker implements Runnable {
|
||||
myThreads.remove(thread);
|
||||
}
|
||||
|
||||
public void registerShutdownTask(@NotNull Runnable task, @NotNull Disposable parentDisposable) {
|
||||
registerShutdownTask(task);
|
||||
Disposer.register(parentDisposable, () -> unregisterShutdownTask(task));
|
||||
}
|
||||
|
||||
public synchronized void registerShutdownTask(@NotNull Runnable task) {
|
||||
myShutdownTasks.addLast(task);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user