Merge pull request #6676 from peppy/fix-multi-logout-crash

Fix multi logout crash
This commit is contained in:
Dan Balasescu
2019-11-01 17:13:16 +09:00
committed by GitHub

View File

@ -167,14 +167,17 @@ namespace osu.Game.Screens.Multi
public void APIStateChanged(IAPIProvider api, APIState state) public void APIStateChanged(IAPIProvider api, APIState state)
{ {
if (state != APIState.Online) if (state != APIState.Online)
forcefullyExit(); Schedule(forcefullyExit);
} }
private void forcefullyExit() private void forcefullyExit()
{ {
// This is temporary since we don't currently have a way to force screens to be exited // This is temporary since we don't currently have a way to force screens to be exited
if (this.IsCurrentScreen()) if (this.IsCurrentScreen())
this.Exit(); {
while (this.IsCurrentScreen())
this.Exit();
}
else else
{ {
this.MakeCurrent(); this.MakeCurrent();