Fix crash on restart after update.

Also make update process more graceful.
This commit is contained in:
Dean Herbert
2017-04-11 18:40:39 +09:00
parent 9732110bd9
commit 7d7bea7198
2 changed files with 19 additions and 2 deletions

View File

@ -307,6 +307,18 @@ namespace osu.Game
return base.OnExiting();
}
/// <summary>
/// Use to programatically exit the game as if the user was triggering via alt-f4.
/// Will keep persisting until an exit occurs (exit may be blocked multiple times).
/// </summary>
public void GracefullyExit()
{
if (!OnExiting())
Exit();
else
Scheduler.AddDelayed(GracefullyExit, 2000);
}
protected override void UpdateAfterChildren()
{
base.UpdateAfterChildren();