1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 20:22:55 +08:00

Fix editor crash on exit when forcing exit twice in a row

This commit is contained in:
Dean Herbert 2020-10-28 13:32:39 +09:00
parent df5348cd93
commit 01b576c861

View File

@ -444,12 +444,21 @@ namespace osu.Game.Screens.Edit
if (dialogOverlay == null || dialogOverlay.CurrentDialog is PromptForSaveDialog)
{
confirmExit();
return true;
return false;
}
if (isNewBeatmap || HasUnsavedChanges)
{
dialogOverlay?.Push(new PromptForSaveDialog(confirmExit, confirmExitWithSave));
dialogOverlay?.Push(new PromptForSaveDialog(() =>
{
confirmExit();
this.Exit();
}, () =>
{
confirmExitWithSave();
this.Exit();
}));
return true;
}
}
@ -464,7 +473,6 @@ namespace osu.Game.Screens.Edit
{
exitConfirmed = true;
Save();
this.Exit();
}
private void confirmExit()
@ -483,7 +491,6 @@ namespace osu.Game.Screens.Edit
}
exitConfirmed = true;
this.Exit();
}
private readonly Bindable<string> clipboard = new Bindable<string>();