1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-19 11:23:23 +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)
{
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>();