mirror of
https://github.com/ppy/osu
synced 2025-01-18 20:10:49 +00:00
Make background update happens in update thread, and thread-safer.
This commit is contained in:
parent
d63e3b6724
commit
000c2218b8
@ -249,13 +249,13 @@ namespace osu.Game.Overlays
|
||||
private void play(BeatmapInfo info, bool? isNext)
|
||||
{
|
||||
current = database.GetWorkingBeatmap(info, current);
|
||||
Task.Factory.StartNew(() =>
|
||||
Task.Run(() =>
|
||||
{
|
||||
trackManager.SetExclusive(current.Track);
|
||||
current.Track.Start();
|
||||
beatmapSource.Value = current;
|
||||
updateCurrent(current, isNext);
|
||||
});
|
||||
updateCurrent(current, isNext);
|
||||
}
|
||||
|
||||
private void updateCurrent(WorkingBeatmap beatmap, bool? isNext)
|
||||
@ -284,7 +284,7 @@ namespace osu.Game.Overlays
|
||||
}
|
||||
else
|
||||
{
|
||||
Remove(backgroundSprite);
|
||||
backgroundSprite.Expire();
|
||||
}
|
||||
|
||||
backgroundSprite = newBackground;
|
||||
|
Loading…
Reference in New Issue
Block a user