Kotlin Gradle Plugin - clean caches for in-process compilation

This is to prevent file handle leaks on Windows. This
commit disposes KotlinCoreEnvironment used during
in-process compilation.

^KT-49772 Fixed
This commit is contained in:
Ivan Gavrilovic
2021-11-15 23:43:36 +00:00
committed by Yahor Berdnikau
parent 7f3b546288
commit 684273783f
2 changed files with 10 additions and 0 deletions
@@ -573,6 +573,7 @@ class KotlinCoreEnvironment private constructor(
/**
* This method is also used in Gradle after configuration phase finished.
*/
@JvmStatic
fun disposeApplicationEnvironment() {
synchronized(APPLICATION_LOCK) {
val environment = ourApplicationEnvironment ?: return