From b5e197e2dc2d46d570509152d5dcdc7c862a70ad Mon Sep 17 00:00:00 2001 From: JosJuice Date: Fri, 23 Jun 2023 20:40:04 +0200 Subject: [PATCH] Android: Handle game shutdown in onTitleChanged --- .../dolphinemu/activities/EmulationActivity.kt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/EmulationActivity.kt b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/EmulationActivity.kt index 9d189eac32..8ad871a57d 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/EmulationActivity.kt +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/EmulationActivity.kt @@ -234,9 +234,14 @@ class EmulationActivity : AppCompatActivity(), ThemeProvider { menuToastShown = true } - title = NativeLibrary.GetCurrentTitleDescription() + try { + title = NativeLibrary.GetCurrentTitleDescription() - emulationFragment?.refreshInputOverlay() + emulationFragment?.refreshInputOverlay() + } catch (_: IllegalStateException) { + // Most likely the core delivered an onTitleChanged while emulation was shutting down. + // Let's just ignore it, since we're about to shut down anyway. + } } override fun onDestroy() {