1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-21 06:52:55 +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
commit 583ed29199
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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