mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 16:59:53 +09:00
Replace usage of .Result
with .WaitSafelyForResult
This commit is contained in:
@ -10,6 +10,7 @@ using System.Threading.Tasks;
|
||||
using JetBrains.Annotations;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Extensions;
|
||||
using osu.Framework.Lists;
|
||||
using osu.Framework.Logging;
|
||||
using osu.Framework.Threading;
|
||||
@ -266,8 +267,11 @@ namespace osu.Game.Beatmaps
|
||||
// We're on a threadpool thread, but we should exit back to the update thread so consumers can safely handle value-changed events.
|
||||
Schedule(() =>
|
||||
{
|
||||
if (!cancellationToken.IsCancellationRequested && t.Result != null)
|
||||
bindable.Value = t.Result;
|
||||
if (cancellationToken.IsCancellationRequested)
|
||||
return;
|
||||
|
||||
if (t.WaitSafelyForResult() is StarDifficulty sd)
|
||||
bindable.Value = sd;
|
||||
});
|
||||
}, cancellationToken);
|
||||
}
|
||||
|
Reference in New Issue
Block a user