From a4eff2acc1107d8bf07e9cbc0dc8227952d8b02d Mon Sep 17 00:00:00 2001 From: JosJuice Date: Fri, 8 Dec 2023 19:30:05 +0100 Subject: [PATCH] Android: Don't call Run before directory initialization Combined with the previous commits, this finally fixes the bug where Dolphin had a chance of crashing if you returned to it after Android killed the Dolphin process. --- .../org/dolphinemu/dolphinemu/fragments/EmulationFragment.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/EmulationFragment.kt b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/EmulationFragment.kt index e403e7ef5d..637f4fb924 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/EmulationFragment.kt +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/EmulationFragment.kt @@ -16,6 +16,7 @@ import org.dolphinemu.dolphinemu.databinding.FragmentEmulationBinding import org.dolphinemu.dolphinemu.features.settings.model.BooleanSetting import org.dolphinemu.dolphinemu.features.settings.model.Settings import org.dolphinemu.dolphinemu.overlay.InputOverlay +import org.dolphinemu.dolphinemu.utils.AfterDirectoryInitializationRunner import org.dolphinemu.dolphinemu.utils.Log import java.io.File @@ -100,7 +101,9 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback { if (NativeLibrary.IsGameMetadataValid()) inputOverlay?.refreshControls() - run(emulationActivity!!.isActivityRecreated) + AfterDirectoryInitializationRunner().runWithLifecycle(this) { + run(emulationActivity!!.isActivityRecreated) + } } override fun onPause() {