mirror of
https://github.com/ppy/osu
synced 2024-12-29 10:22:43 +00:00
Merge pull request #19079 from peppy/fix-audio-playback-disposed
Fix potential crash during shutdown sequence if intro playback was aborted
This commit is contained in:
commit
bd6f8bde9f
@ -72,9 +72,17 @@ namespace osu.Game.Screens.Menu
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Clock = decoupledClock,
|
||||
LoadMenu = LoadMenu
|
||||
}, t =>
|
||||
}, _ =>
|
||||
{
|
||||
AddInternal(t);
|
||||
AddInternal(intro);
|
||||
|
||||
// There is a chance that the intro timed out before being displayed, and this scheduled callback could
|
||||
// happen during the outro rather than intro.
|
||||
// In such a scenario, we don't want to play the intro sample, nor attempt to start the intro track
|
||||
// (that may have already been since disposed by MusicController).
|
||||
if (DidLoadMenu)
|
||||
return;
|
||||
|
||||
if (!UsingThemedIntro)
|
||||
welcome?.Play();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user