Fix multiple resource leaks by closing InputStream instances
The main fix is in BuiltInsPackageFragment, the rest is the improvement of other usages of getResourceAsStream #KT-11433 Fixed
This commit is contained in:
+1
-1
@@ -25,7 +25,7 @@ class RuntimePackagePartProvider(private val classLoader: ClassLoader) : Package
|
||||
|
||||
fun registerModule(moduleName: String) {
|
||||
val mapping = try {
|
||||
classLoader.getResourceAsStream("META-INF/$moduleName.${ModuleMapping.MAPPING_FILE_EXT}")?.let { stream ->
|
||||
classLoader.getResourceAsStream("META-INF/$moduleName.${ModuleMapping.MAPPING_FILE_EXT}")?.use { stream ->
|
||||
ModuleMapping.create(stream.readBytes())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user