mirror of
https://github.com/ppy/osu.git
synced 2024-11-13 19:27:31 +08:00
Safeguard against potential finalise-before-initialised
This commit is contained in:
parent
a57b6bdc18
commit
4648362214
@ -136,11 +136,14 @@ namespace osu.Game.Beatmaps
|
|||||||
trackedUpdateCancellationSource?.Cancel();
|
trackedUpdateCancellationSource?.Cancel();
|
||||||
trackedUpdateCancellationSource = null;
|
trackedUpdateCancellationSource = null;
|
||||||
|
|
||||||
|
if (linkedCancellationSources != null)
|
||||||
|
{
|
||||||
foreach (var c in linkedCancellationSources)
|
foreach (var c in linkedCancellationSources)
|
||||||
c.Dispose();
|
c.Dispose();
|
||||||
|
|
||||||
linkedCancellationSources.Clear();
|
linkedCancellationSources.Clear();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a new <see cref="BindableStarDifficulty"/> and triggers an initial value update.
|
/// Creates a new <see cref="BindableStarDifficulty"/> and triggers an initial value update.
|
||||||
@ -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>
|
||||||
|
Loading…
Reference in New Issue
Block a user