mirror of
https://github.com/ppy/osu.git
synced 2024-11-06 11:27:24 +08: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,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Clock = decoupledClock,
|
Clock = decoupledClock,
|
||||||
LoadMenu = LoadMenu
|
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)
|
if (!UsingThemedIntro)
|
||||||
welcome?.Play();
|
welcome?.Play();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user