Lock one more case of usage

This commit is contained in:
Dean Herbert 2021-10-14 16:22:43 +09:00
parent 060bb1afbd
commit 8a4c0c0ac8
1 changed files with 7 additions and 4 deletions

View File

@ -189,11 +189,14 @@ public void BeginAsyncLoad()
/// </summary>
public void CancelAsyncLoad()
{
loadCancellation?.Cancel();
loadCancellation = new CancellationTokenSource();
lock (beatmapFetchLock)
{
loadCancellation?.Cancel();
loadCancellation = new CancellationTokenSource();
if (beatmapLoadTask?.IsCompleted != true)
beatmapLoadTask = null;
if (beatmapLoadTask?.IsCompleted != true)
beatmapLoadTask = null;
}
}
private CancellationTokenSource createCancellationTokenSource(TimeSpan? timeout)