From 320309aadd927c83d95723157ae74aac28ee3bdd Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Mon, 12 Jun 2023 18:36:34 +0300 Subject: [PATCH] Don't kill the multiplayer updater on *pause*, instead on destroy() "exit early" --- core/src/com/unciv/UncivGame.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/com/unciv/UncivGame.kt b/core/src/com/unciv/UncivGame.kt index 90aa7e5c44..4662cb1cf5 100644 --- a/core/src/com/unciv/UncivGame.kt +++ b/core/src/com/unciv/UncivGame.kt @@ -446,8 +446,6 @@ open class UncivGame(val isConsoleMode: Boolean = false) : Game(), PlatformSpeci val curGameInfo = gameInfo if (curGameInfo != null) files.requestAutoSave(curGameInfo) if (::musicController.isInitialized) musicController.pause() - // We stop the *in-game* multiplayer update, so that when we resume(), it doesn't keep working and A. we'll have errors and B. we'll have multiple updaters active - if (::onlineMultiplayer.isInitialized) onlineMultiplayer.multiplayerGameUpdater.cancel() super.pause() } @@ -461,6 +459,8 @@ open class UncivGame(val isConsoleMode: Boolean = false) : Game(), PlatformSpeci Gdx.input.inputProcessor = null // don't allow ANRs when shutting down, that's silly SoundPlayer.clearCache() if (::musicController.isInitialized) musicController.gracefulShutdown() // Do allow fade-out + // We stop the *in-game* multiplayer update, so that it doesn't keep working and A. we'll have errors and B. we'll have multiple updaters active + if (::onlineMultiplayer.isInitialized) onlineMultiplayer.multiplayerGameUpdater.cancel() val curGameInfo = gameInfo if (curGameInfo != null) {