Skip to content

Commit

Permalink
Android: Don't call Run before directory initialization
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
JosJuice committed Dec 8, 2023
1 parent a31214b commit a4eff2a
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit a4eff2a

Please sign in to comment.