mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2026-05-06 05:15:47 +00:00
UI: LoadGuestApplication asynchronous cancellation (#1)
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. Closes [#20](https://github.com/Ryubing/Issues/issues/20) Reviewed-on: https://git.ryujinx.app/projects/Ryubing/pulls/1
This commit is contained in:
@@ -1760,11 +1760,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(
|
||||
@@ -1778,18 +1773,34 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
UserChannelPersistence,
|
||||
this,
|
||||
TopLevel);
|
||||
|
||||
CancellationTokenSource cts = new CancellationTokenSource();
|
||||
|
||||
if (!await AppHost.LoadGuestApplication(customNacpData))
|
||||
try
|
||||
{
|
||||
await AppHost.LoadGuestApplication(cts, customNacpData);
|
||||
}
|
||||
catch (OperationCanceledException exception)
|
||||
{
|
||||
Logger.Info?.Print(LogClass.Application,
|
||||
"LoadGuestApplication was interrupted !!! " + exception.Message);
|
||||
AppHost.DisposeContext();
|
||||
AppHost = null;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
finally
|
||||
{
|
||||
cts.Dispose();
|
||||
}
|
||||
|
||||
CanUpdate = false;
|
||||
|
||||
application.Name ??= AppHost.Device.Processes.ActiveApplication.Name;
|
||||
|
||||
SelectedIcon ??= ApplicationLibrary.GetApplicationIcon(application.Path,
|
||||
ConfigurationState.Instance.System.Language, application.Id);
|
||||
|
||||
PrepareLoadScreen();
|
||||
|
||||
LoadHeading = LocaleManager.Instance.UpdateAndGetDynamicValue(LocaleKeys.LoadingHeading, application.Name);
|
||||
|
||||
@@ -1811,9 +1822,9 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
RendererHostControl.Focus();
|
||||
});
|
||||
|
||||
public static void UpdateGameMetadata(string titleId, TimeSpan playTime)
|
||||
public static void UpdateGameMetadata(string titleId, TimeSpan playTime)
|
||||
=> ApplicationLibrary.LoadAndSaveMetaData(titleId, appMetadata => appMetadata.UpdatePostGame(playTime));
|
||||
|
||||
|
||||
public void RefreshFirmwareStatus()
|
||||
{
|
||||
SystemVersion version = null;
|
||||
|
||||
Reference in New Issue
Block a user