UI: LoadGuestApplication asynchronous cancellation

Fixed LoadGuestApplication hanging when cancelled.
Since startup procedure has technically changed, we should consider testing this with a variety of game formats to ensure regressions do not occur.
This commit is contained in:
Max
2026-05-04 01:48:31 -05:00
committed by KeatonTheBot
parent 7f99e32a0a
commit 4b4fd560ed
6 changed files with 112 additions and 44 deletions
@@ -1634,10 +1634,6 @@ namespace Ryujinx.Ava.UI.ViewModels
Logger.RestartTime();
SelectedIcon ??= ApplicationLibrary.GetApplicationIcon(application.Path, ConfigurationState.Instance.System.Language, application.Id);
PrepareLoadScreen();
RendererHostControl = new RendererHost();
AppHost = new AppHost(
@@ -1652,18 +1648,34 @@ namespace Ryujinx.Ava.UI.ViewModels
this,
TopLevel);
if (!await AppHost.LoadGuestApplication())
CancellationTokenSource cts = new CancellationTokenSource();
try
{
await AppHost.LoadGuestApplication(cts);
}
catch (OperationCanceledException exception)
{
Logger.Info?.Print(LogClass.Application,
"LoadGuestApplication was interrupted !!! " + exception.Message);
AppHost.DisposeContext();
AppHost = null;
return;
}
finally
{
cts.Dispose();
}
CanUpdate = false;
LoadHeading = application.Name;
SelectedIcon ??= ApplicationLibrary.GetApplicationIcon(application.Path,
ConfigurationState.Instance.System.Language, application.Id);
PrepareLoadScreen();
if (string.IsNullOrWhiteSpace(application.Name))
{
LoadHeading = LocaleManager.Instance.UpdateAndGetDynamicValue(LocaleKeys.LoadingHeading, AppHost.Device.Processes.ActiveApplication.Name);