1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-18 04:59:52 +08:00

Merge pull request #10608 from peppy/fix-editor-bindable-crash

Fix editor crash on exit when forcing exit twice in a row
This commit is contained in:
Dan Balasescu
2020-10-29 11:11:53 +09:00
committed by GitHub
Unverified
+11 -4
View File
@@ -450,12 +450,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;
}
}
@@ -470,7 +479,6 @@ namespace osu.Game.Screens.Edit
{
exitConfirmed = true;
Save();
this.Exit();
}
private void confirmExit()
@@ -489,7 +497,6 @@ namespace osu.Game.Screens.Edit
}
exitConfirmed = true;
this.Exit();
}
private readonly Bindable<string> clipboard = new Bindable<string>();