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

Fix threading failure

Implicitly showing the medal overlay fires off some transforms, and the
websocket listener runs on a TPL thread. That's a recipe for disaster,
so schedule the show call.
This commit is contained in:
Bartłomiej Dach 2024-02-20 15:02:30 +01:00
parent 8abcc70b93
commit 96825915f7
No known key found for this signature in database

View File

@ -22,6 +22,8 @@ namespace osu.Game.Overlays
protected override string? PopInSampleName => null;
protected override string? PopOutSampleName => null;
public override bool IsPresent => base.IsPresent || Scheduler.HasPendingTasks;
protected override void PopIn() => this.FadeIn();
protected override void PopOut() => this.FadeOut();
@ -52,7 +54,7 @@ namespace osu.Game.Overlays
OverlayActivationMode.BindValueChanged(val =>
{
if (val.NewValue != OverlayActivation.Disabled && queuedMedals.Any())
if (val.NewValue != OverlayActivation.Disabled && (queuedMedals.Any() || medalContainer.Any()))
Show();
}, true);
}
@ -79,7 +81,7 @@ namespace osu.Game.Overlays
var medalAnimation = new MedalAnimation(medal);
queuedMedals.Enqueue(medalAnimation);
Show();
Scheduler.AddOnce(Show);
}
protected override void Update()