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.
This commit is contained in:
JosJuice 2023-12-08 19:30:05 +01:00
parent a31214b8c6
commit a4eff2acc1
1 changed files with 4 additions and 1 deletions

View File

@ -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.BooleanSetting
import org.dolphinemu.dolphinemu.features.settings.model.Settings import org.dolphinemu.dolphinemu.features.settings.model.Settings
import org.dolphinemu.dolphinemu.overlay.InputOverlay import org.dolphinemu.dolphinemu.overlay.InputOverlay
import org.dolphinemu.dolphinemu.utils.AfterDirectoryInitializationRunner
import org.dolphinemu.dolphinemu.utils.Log import org.dolphinemu.dolphinemu.utils.Log
import java.io.File import java.io.File
@ -100,7 +101,9 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback {
if (NativeLibrary.IsGameMetadataValid()) if (NativeLibrary.IsGameMetadataValid())
inputOverlay?.refreshControls() inputOverlay?.refreshControls()
run(emulationActivity!!.isActivityRecreated) AfterDirectoryInitializationRunner().runWithLifecycle(this) {
run(emulationActivity!!.isActivityRecreated)
}
} }
override fun onPause() { override fun onPause() {