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

Merge pull request #22535 from peppy/forcefully-stop-pause-sample

Ensure pause sample loop is stopped on exiting player
This commit is contained in:
Bartłomiej Dach 2023-02-06 19:51:51 +01:00 committed by GitHub
commit 3ee771cbef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View File

@ -44,6 +44,14 @@ namespace osu.Game.Screens.Play
});
}
public void StopAllSamples()
{
if (!IsLoaded)
return;
pauseLoop.Stop();
}
protected override void PopIn()
{
base.PopIn();

View File

@ -1073,7 +1073,10 @@ namespace osu.Game.Screens.Play
public override bool OnExiting(ScreenExitEvent e)
{
screenSuspension?.RemoveAndDisposeImmediately();
// Eagerly clean these up as disposal of child components is asynchronous and may leave sounds playing beyond user expectations.
failAnimationLayer?.Stop();
PauseOverlay?.StopAllSamples();
if (LoadedBeatmapSuccessfully)
{