Skip to content

Commit

Permalink
Fixing Kaga not properly shutting down
Browse files Browse the repository at this point in the history
  • Loading branch information
waicool20 committed Mar 10, 2017
1 parent 7a0ff96 commit dca87ce
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/main/kotlin/com/waicool20/kaga/Kaga.kt
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ class Kaga : Application() {
fun setLogLevel(level: Level) {
(LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME) as Logger).level = level
}

fun exit() {
KANCOLLE_AUTO.stop()
Platform.exit()
System.exit(0)
}
}

override fun start(stage: Stage) {
Expand All @@ -70,7 +76,7 @@ class Kaga : Application() {
logger.info("Starting KAGA")
FX.registerApplication(application = this, primaryStage = stage)
ROOT_STAGE = stage
stage.setOnHidden { Platform.exit() }
stage.setOnHidden { exit() }
CONFIG = KagaConfig.load()
if (CONFIG.isValid()) {
if (logLevel == "") {
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/com/waicool20/kaga/views/KagaView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -188,5 +188,5 @@ class KagaView {

@FXML private fun openStats() = Kaga.STATS_STAGE.show()

@FXML private fun quit() = System.exit(0)
@FXML private fun quit() = Kaga.exit()
}

0 comments on commit dca87ce

Please sign in to comment.