mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 23:12:56 +08:00
Merge pull request #16187 from peppy/fix-threading-colour-error-meter
Fix potential wrong thread mutation in `ColourHitErrorMeter`
This commit is contained in:
commit
3b700b6967
@ -40,9 +40,16 @@ namespace osu.Game.Screens.Play.HUD.HitErrorMeters
|
||||
if (gameplayClockContainer != null)
|
||||
gameplayClockContainer.OnSeek += Clear;
|
||||
|
||||
processor.NewJudgement += OnNewJudgement;
|
||||
processor.NewJudgement += processorNewJudgement;
|
||||
}
|
||||
|
||||
// Scheduled as meter implementations are likely going to change/add drawables when reacting to this.
|
||||
private void processorNewJudgement(JudgementResult j) => Schedule(() => OnNewJudgement(j));
|
||||
|
||||
/// <summary>
|
||||
/// Fired when a new judgement arrives.
|
||||
/// </summary>
|
||||
/// <param name="judgement">The new judgement.</param>
|
||||
protected abstract void OnNewJudgement(JudgementResult judgement);
|
||||
|
||||
protected Color4 GetColourForHitResult(HitResult result)
|
||||
@ -84,7 +91,7 @@ namespace osu.Game.Screens.Play.HUD.HitErrorMeters
|
||||
base.Dispose(isDisposing);
|
||||
|
||||
if (processor != null)
|
||||
processor.NewJudgement -= OnNewJudgement;
|
||||
processor.NewJudgement -= processorNewJudgement;
|
||||
|
||||
if (gameplayClockContainer != null)
|
||||
gameplayClockContainer.OnSeek -= Clear;
|
||||
|
Loading…
Reference in New Issue
Block a user