From 8e0ae330f04768de295aced817d93663f47b59d5 Mon Sep 17 00:00:00 2001 From: Moritz Lintterer Date: Fri, 12 Aug 2022 11:09:51 +0200 Subject: [PATCH] fix: add classGraphScanner close to the end --- .../src/main/scala/de/innfactory/smithy4play/AutoRouter.scala | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/smithy4play/src/main/scala/de/innfactory/smithy4play/AutoRouter.scala b/smithy4play/src/main/scala/de/innfactory/smithy4play/AutoRouter.scala index 394a8c78..1a87b5f9 100644 --- a/smithy4play/src/main/scala/de/innfactory/smithy4play/AutoRouter.scala +++ b/smithy4play/src/main/scala/de/innfactory/smithy4play/AutoRouter.scala @@ -24,7 +24,9 @@ class AutoRouter @Inject( val classGraphScanner: ScanResult = new ClassGraph().enableAllInfo().acceptPackages(pkg).scan() val controllers = classGraphScanner.getClassesImplementing(classOf[AutoRoutableController]) logger.debug(s"[AutoRouter] found ${controllers.size()} Controllers") - controllers.asScala.map(_.loadClass(true)).map(clazz => createFromClass(clazz)).toSeq + val routes = controllers.asScala.map(_.loadClass(true)).map(clazz => createFromClass(clazz)).toSeq + classGraphScanner.close() + routes } def createFromClass(clazz: Class[_]): Routes =