Merge branch 'master' into realm-fix-async-write-after-disposal

This commit is contained in:
Dean Herbert
2022-06-29 22:39:05 +09:00
149 changed files with 542 additions and 518 deletions

View File

@ -3,6 +3,7 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using osu.Framework.Platform;
@ -46,6 +47,7 @@ namespace osu.Game.Database
Realm.Realm.Write(realm =>
{
var managed = realm.Find<TModel>(item.ID);
Debug.Assert(managed != null);
operation(managed);
item.Files.Clear();

View File

@ -128,7 +128,7 @@ namespace osu.Game.Database
Logger.Log(@$"Opened realm ""{updateRealm.Config.DatabasePath}"" at version {updateRealm.Config.SchemaVersion}");
// Resubscribe any subscriptions
foreach (var action in customSubscriptionsResetMap.Keys)
foreach (var action in customSubscriptionsResetMap.Keys.ToArray())
registerSubscription(action);
}

View File

@ -296,7 +296,8 @@ namespace osu.Game.Database
try
{
LogForModel(item, @"Beginning import...");
// Log output here will be missing a valid hash in non-batch imports.
LogForModel(item, $@"Beginning import from {archive?.Name ?? "unknown"}...");
// TODO: do we want to make the transaction this local? not 100% sure, will need further investigation.
using (var transaction = realm.BeginWrite())