mirror of
https://github.com/corda/corda.git
synced 2025-03-13 07:54:32 +00:00
Close classloader after use
This commit is contained in:
parent
5e4bb30d1a
commit
6070bc061d
@ -26,6 +26,7 @@ fun scanJarForContracts(cordappJarPath: String): List<ContractClassName> {
|
||||
// Only keep instantiable contracts
|
||||
val classLoader = URLClassLoader(arrayOf(File(cordappJarPath).toURL()), currentClassLoader)
|
||||
val concreteContracts = contracts.map(classLoader::loadClass).filter { !it.isInterface && !Modifier.isAbstract(it.modifiers) }
|
||||
classLoader.close()
|
||||
return concreteContracts.map { it.name }
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user