1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 13:42:56 +08:00

Catch OperationCanceledException in single file load sequence

This commit is contained in:
Dean Herbert 2018-08-20 14:42:37 +09:00
parent 9376a4fe49
commit 65dc9f44e5

View File

@ -504,7 +504,16 @@ namespace osu.Game
// schedule is here to ensure that all component loads are done after LoadComplete is run (and thus all dependencies are cached).
// with some better organisation of LoadComplete to do construction and dependency caching in one step, followed by calls to loadComponentSingleFile,
// we could avoid the need for scheduling altogether.
Schedule(() => { asyncLoadStream = asyncLoadStream?.ContinueWith(t => LoadComponentAsync(d, add).Wait()) ?? LoadComponentAsync(d, add); });
Schedule(() => { asyncLoadStream = asyncLoadStream?.ContinueWith(async t =>
{
try
{
await LoadComponentAsync(d, add);
}
catch (OperationCanceledException)
{
}
}) ?? LoadComponentAsync(d, add); });
}
public bool OnPressed(GlobalAction action)