Clear request cache properly during disposing component

This commit is contained in:
Victor Petukhov
2021-02-11 16:08:56 +03:00
parent 6f64fd2fec
commit a94086224d
@@ -49,6 +49,11 @@ class KotlinBinaryClassCache : Disposable {
}
override fun dispose() {
cache.get().apply {
result = null
virtualFile = null
}
// This is only relevant for tests. We create a new instance of Application for each test, and so a new instance of this service is
// also created for each test. However all tests share the same event dispatch thread, which would collect all instances of this
// thread-local if they're not removed properly. Each instance would transitively retain VFS resulting in OutOfMemoryError