mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
(part of IJPL-220534) clean internal datastructures holding references to services on dispose, to make memdumps shorter and memleaks more revealing
GitOrigin-RevId: 8b506d01038c709b097571b32c5d81f8f557cf9c
This commit is contained in:
committed by
intellij-monorepo-bot
parent
f8ffdf7da7
commit
66f4aad23f
@@ -1185,6 +1185,7 @@ abstract class ComponentManagerImpl(
|
||||
if (!containerState.compareAndSet(ContainerState.DISPOSED, ContainerState.DISPOSE_COMPLETED)) {
|
||||
throw IllegalStateException("Expected current state is DISPOSED, but actual state is ${containerState.get()} ($this)")
|
||||
}
|
||||
pluginServicesStore.clearPotentialLeaks()
|
||||
}
|
||||
|
||||
override fun stopServicePreloading() {
|
||||
@@ -1421,6 +1422,11 @@ private class PluginServicesStore {
|
||||
fun removeDynamicServices(descriptor: IdeaPluginDescriptor): List<InstanceHolder> {
|
||||
return dynamicServices.remove(descriptor)?.toList() ?: java.util.List.of()
|
||||
}
|
||||
|
||||
fun clearPotentialLeaks() {
|
||||
dynamicServices.clear()
|
||||
regularServices.clear()
|
||||
}
|
||||
}
|
||||
|
||||
private fun createPluginExceptionIfNeeded(error: Throwable, pluginId: PluginId): RuntimeException {
|
||||
|
||||
Reference in New Issue
Block a user