Merge pull request #20479 from peppy/fix-drawable-mutation-misc

Fix potential crash on game exit due to incorrect scheduling of realm change handler
This commit is contained in:
Dan Balasescu 2022-09-26 18:02:28 +09:00 committed by GitHub
commit 525de8c140
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -123,7 +123,7 @@ namespace osu.Game.Overlays.FirstRunSetup
beatmapSubscription?.Dispose();
}
private void beatmapsChanged(IRealmCollection<BeatmapSetInfo> sender, ChangeSet? changes, Exception error)
private void beatmapsChanged(IRealmCollection<BeatmapSetInfo> sender, ChangeSet? changes, Exception error) => Schedule(() =>
{
currentlyLoadedBeatmaps.Text = FirstRunSetupBeatmapScreenStrings.CurrentlyLoadedBeatmaps(sender.Count);
@ -139,7 +139,7 @@ namespace osu.Game.Overlays.FirstRunSetup
currentlyLoadedBeatmaps.ScaleTo(1.1f)
.ScaleTo(1, 1500, Easing.OutQuint);
}
}
});
private void downloadTutorial()
{

View File

@ -58,6 +58,9 @@ namespace osu.Game.Rulesets.Configuration
pendingWrites.Clear();
}
if (!changed.Any())
return true;
realm?.Write(r =>
{
foreach (var c in changed)