From c7b9f694c7700c4a8b02ff9d64c8e65b881dd285 Mon Sep 17 00:00:00 2001 From: Mike Cifelli Date: Sun, 21 Oct 2018 08:50:56 -0400 Subject: [PATCH] Properly close ClassGraph scan --- src/main/kotlin/table/FunctionTable.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/table/FunctionTable.kt b/src/main/kotlin/table/FunctionTable.kt index 4390387..012c6a7 100644 --- a/src/main/kotlin/table/FunctionTable.kt +++ b/src/main/kotlin/table/FunctionTable.kt @@ -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>() .toSet()