Properly close ClassGraph scan

This commit is contained in:
Mike Cifelli 2018-10-21 08:50:56 -04:00
parent 0695ddc1f2
commit c7b9f694c7
1 changed files with 2 additions and 2 deletions

View File

@ -14,8 +14,8 @@ object FunctionTable {
.enableAnnotationInfo()
.whitelistPackages("function.builtin")
private val allBuiltIns = with(classGraph.scan()) {
getClassesWithAnnotation(FunctionNames::class.qualifiedName)
private val allBuiltIns = classGraph.scan().use { scan ->
scan.getClassesWithAnnotation(FunctionNames::class.qualifiedName)
.map { it.loadClass() }
.filterIsInstance<Class<out LispFunction>>()
.toSet()