mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2025-01-14 22:50:34 +00:00
Prevent crash when game is corrupted.
This commit is contained in:
parent
9a1b74799d
commit
3df818c894
2 changed files with 30 additions and 8 deletions
|
@ -650,5 +650,6 @@
|
||||||
"NetworkInterfaceDefault": "Default",
|
"NetworkInterfaceDefault": "Default",
|
||||||
"PackagingShaders": "Packaging Shaders",
|
"PackagingShaders": "Packaging Shaders",
|
||||||
"AboutChangelogButton": "View Changelog on GitHub",
|
"AboutChangelogButton": "View Changelog on GitHub",
|
||||||
"AboutChangelogButtonTooltipMessage": "Click to open the changelog for this version in your default browser."
|
"AboutChangelogButtonTooltipMessage": "Click to open the changelog for this version in your default browser.",
|
||||||
|
"DialogCorruptedGameError": "It appears this game is corrupted. Please dump the game again.\nInternal error code: {0}"
|
||||||
}
|
}
|
|
@ -1480,10 +1480,29 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||||
|
|
||||||
async void Action()
|
async void Action()
|
||||||
{
|
{
|
||||||
if (!await AppHost.LoadGuestApplication())
|
var loadSuccessful = false;
|
||||||
|
try
|
||||||
{
|
{
|
||||||
AppHost.DisposeContext();
|
loadSuccessful = await AppHost.LoadGuestApplication();
|
||||||
|
}
|
||||||
|
catch (HorizonResultException hex)
|
||||||
|
{
|
||||||
|
// Apphost Cleanup
|
||||||
AppHost = null;
|
AppHost = null;
|
||||||
|
SelectedIcon = null;
|
||||||
|
|
||||||
|
await Dispatcher.UIThread.InvokeAsync(async () =>
|
||||||
|
{
|
||||||
|
await ContentDialogHelper.CreateErrorDialog(
|
||||||
|
string.Format(LocaleManager.Instance[LocaleKeys.DialogCorruptedGameError], hex.Message));
|
||||||
|
});
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!loadSuccessful)
|
||||||
|
{
|
||||||
|
PostAppCleanup();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1561,6 +1580,11 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AppHost_AppExit(object sender, EventArgs e)
|
public void AppHost_AppExit(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
PostAppCleanup();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void PostAppCleanup()
|
||||||
{
|
{
|
||||||
if (IsClosing)
|
if (IsClosing)
|
||||||
{
|
{
|
||||||
|
@ -1590,10 +1614,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||||
|
|
||||||
SelectedIcon = null;
|
SelectedIcon = null;
|
||||||
|
|
||||||
Dispatcher.UIThread.InvokeAsync(() =>
|
Dispatcher.UIThread.InvokeAsync(() => { Title = $"Ryujinx {Program.Version}"; });
|
||||||
{
|
|
||||||
Title = $"Ryujinx {Program.Version}";
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ToggleFullscreen()
|
public void ToggleFullscreen()
|
||||||
|
|
Loading…
Reference in a new issue