diff --git a/osu.Game/Screens/Play/PlayerLoader.cs b/osu.Game/Screens/Play/PlayerLoader.cs index cdb6f36a6f..31e7313c0b 100644 --- a/osu.Game/Screens/Play/PlayerLoader.cs +++ b/osu.Game/Screens/Play/PlayerLoader.cs @@ -131,16 +131,22 @@ namespace osu.Game.Screens.Play private void pushWhenLoaded() { - Schedule(pushWhenLoaded); + if (!IsCurrentScreen) return; - if (!readyForPush) + try { - pushDebounce?.Cancel(); - pushDebounce = null; - return; - } + if (!readyForPush) + { + // as the pushDebounce below has a delay, we need to keep checking and cancel a future debounce + // if we become unready for push during the delay. + pushDebounce?.Cancel(); + pushDebounce = null; + return; + } + + if (pushDebounce != null) + return; - if (pushDebounce == null) pushDebounce = Scheduler.AddDelayed(() => { contentOut(); @@ -159,6 +165,11 @@ namespace osu.Game.Screens.Play } }); }, 500); + } + finally + { + Schedule(pushWhenLoaded); + } } protected override bool OnExiting(Screen next)