From f37952ae41307435c20a310819672aa925ad9197 Mon Sep 17 00:00:00 2001 From: Denis Nutiu Date: Wed, 27 Mar 2024 23:50:46 +0200 Subject: [PATCH] close image tagger --- src/main/kotlin/dev/nuculabs/imagetagger/ui/MainPage.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/dev/nuculabs/imagetagger/ui/MainPage.kt b/src/main/kotlin/dev/nuculabs/imagetagger/ui/MainPage.kt index 86ee463..6e96a92 100644 --- a/src/main/kotlin/dev/nuculabs/imagetagger/ui/MainPage.kt +++ b/src/main/kotlin/dev/nuculabs/imagetagger/ui/MainPage.kt @@ -12,6 +12,7 @@ import java.util.logging.Logger class MainPage : Application() { private val logger: Logger = Logger.getLogger("MainPage") + private var imageTagger: ImageTagsPrediction? = null private lateinit var fxmlLoader: FXMLLoader @@ -22,7 +23,7 @@ class MainPage : Application() { fxmlLoader = FXMLLoader(MainPage::class.java.getResource("main-window-view.fxml")) mainStage = stage - ImageTagsPrediction.getInstance() + imageTagger = ImageTagsPrediction.getInstance() setUpApplicationIcon() // Load the FXML. @@ -62,6 +63,7 @@ class MainPage : Application() { logger.info("Stop called.") val controller = fxmlLoader.getController() controller.shutdown() + imageTagger?.close() } }