mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 22:56:36 +09:00
Merge pull request #2842 from peppy/fix-background-screen-crash
Fix background screens not supporting early-exit condition
This commit is contained in:
@ -40,7 +40,14 @@ namespace osu.Game.Screens
|
||||
while (screen.LoadState < LoadState.Ready)
|
||||
Thread.Sleep(1);
|
||||
|
||||
base.Push(screen);
|
||||
try
|
||||
{
|
||||
base.Push(screen);
|
||||
}
|
||||
catch (ScreenAlreadyExitedException)
|
||||
{
|
||||
// screen may have exited before the push was successful.
|
||||
}
|
||||
}
|
||||
|
||||
protected override void Update()
|
||||
|
@ -183,11 +183,10 @@ namespace osu.Game.Screens
|
||||
|
||||
if (Background != null && !Background.Equals(nextOsu?.Background))
|
||||
{
|
||||
if (nextOsu != null)
|
||||
//We need to use MakeCurrent in case we are jumping up multiple game screens.
|
||||
nextOsu.Background?.MakeCurrent();
|
||||
else
|
||||
Background.Exit();
|
||||
Background.Exit();
|
||||
|
||||
//We need to use MakeCurrent in case we are jumping up multiple game screens.
|
||||
nextOsu?.Background?.MakeCurrent();
|
||||
}
|
||||
|
||||
if (base.OnExiting(next))
|
||||
|
Reference in New Issue
Block a user