mirror of
https://github.com/ppy/osu.git
synced 2025-02-16 16:23:16 +08:00
Fix preview track crashes
This commit is contained in:
parent
6dfab4d431
commit
db1a0ebb55
@ -138,6 +138,10 @@ namespace osu.Game.Overlays.BeatmapListing.Panels
|
|||||||
loading = true;
|
loading = true;
|
||||||
|
|
||||||
LoadComponentAsync(Preview = previewTrackManager.Get(beatmapSet), preview =>
|
LoadComponentAsync(Preview = previewTrackManager.Get(beatmapSet), preview =>
|
||||||
|
{
|
||||||
|
// Make sure that we schedule to after the next audio frame to fix crashes in single-threaded execution.
|
||||||
|
// See: https://github.com/ppy/osu-framework/issues/4692
|
||||||
|
Schedule(() =>
|
||||||
{
|
{
|
||||||
// beatmapset may have changed.
|
// beatmapset may have changed.
|
||||||
if (Preview != preview)
|
if (Preview != preview)
|
||||||
@ -153,6 +157,7 @@ namespace osu.Game.Overlays.BeatmapListing.Panels
|
|||||||
if (playing.Value)
|
if (playing.Value)
|
||||||
attemptStart();
|
attemptStart();
|
||||||
});
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user