1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-14 16:37:26 +08:00

Safeguard against potential finalise-before-initialised

This commit is contained in:
smoogipoo 2020-07-29 11:30:25 +09:00
parent a57b6bdc18
commit 4648362214

View File

@ -136,10 +136,13 @@ namespace osu.Game.Beatmaps
trackedUpdateCancellationSource?.Cancel(); trackedUpdateCancellationSource?.Cancel();
trackedUpdateCancellationSource = null; trackedUpdateCancellationSource = null;
foreach (var c in linkedCancellationSources) if (linkedCancellationSources != null)
c.Dispose(); {
foreach (var c in linkedCancellationSources)
c.Dispose();
linkedCancellationSources.Clear(); linkedCancellationSources.Clear();
}
} }
/// <summary> /// <summary>
@ -239,7 +242,7 @@ namespace osu.Game.Beatmaps
base.Dispose(isDisposing); base.Dispose(isDisposing);
cancelTrackedBindableUpdate(); cancelTrackedBindableUpdate();
updateScheduler.Dispose(); updateScheduler?.Dispose();
} }
private readonly struct DifficultyCacheLookup : IEquatable<DifficultyCacheLookup> private readonly struct DifficultyCacheLookup : IEquatable<DifficultyCacheLookup>