Revert "Fix KotlinCoreEnvironment projectCount disposable"
This reverts commit 99a6bdeec7.
#KT-45007 Fixed
This commit is contained in:
@@ -501,13 +501,10 @@ class KotlinCoreEnvironment private constructor(
|
|||||||
if (CompilerSystemProperties.KOTLIN_COMPILER_ENVIRONMENT_KEEPALIVE_PROPERTY.value.toBooleanLenient() != true) {
|
if (CompilerSystemProperties.KOTLIN_COMPILER_ENVIRONMENT_KEEPALIVE_PROPERTY.value.toBooleanLenient() != true) {
|
||||||
// JPS may run many instances of the compiler in parallel (there's an option for compiling independent modules in parallel in IntelliJ)
|
// JPS may run many instances of the compiler in parallel (there's an option for compiling independent modules in parallel in IntelliJ)
|
||||||
// All projects share the same ApplicationEnvironment, and when the last project is disposed, the ApplicationEnvironment is disposed as well
|
// All projects share the same ApplicationEnvironment, and when the last project is disposed, the ApplicationEnvironment is disposed as well
|
||||||
@Suppress("ObjectLiteralToLambda") // Disposer tree depends on identity of disposables.
|
Disposer.register(parentDisposable, Disposable {
|
||||||
Disposer.register(parentDisposable, object : Disposable {
|
synchronized(APPLICATION_LOCK) {
|
||||||
override fun dispose() {
|
if (--ourProjectCount <= 0) {
|
||||||
synchronized(APPLICATION_LOCK) {
|
disposeApplicationEnvironment()
|
||||||
if (--ourProjectCount <= 0) {
|
|
||||||
disposeApplicationEnvironment()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user