mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-28 14:24:43 -04:00
Don't kill the multiplayer updater on *pause*, instead on destroy() "exit early"
This commit is contained in:
parent
61a90a4193
commit
320309aadd
@ -446,8 +446,6 @@ open class UncivGame(val isConsoleMode: Boolean = false) : Game(), PlatformSpeci
|
|||||||
val curGameInfo = gameInfo
|
val curGameInfo = gameInfo
|
||||||
if (curGameInfo != null) files.requestAutoSave(curGameInfo)
|
if (curGameInfo != null) files.requestAutoSave(curGameInfo)
|
||||||
if (::musicController.isInitialized) musicController.pause()
|
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()
|
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
|
Gdx.input.inputProcessor = null // don't allow ANRs when shutting down, that's silly
|
||||||
SoundPlayer.clearCache()
|
SoundPlayer.clearCache()
|
||||||
if (::musicController.isInitialized) musicController.gracefulShutdown() // Do allow fade-out
|
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
|
val curGameInfo = gameInfo
|
||||||
if (curGameInfo != null) {
|
if (curGameInfo != null) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user