1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 18:07:23 +08:00

Add explanatory comments

This commit is contained in:
Dean Herbert 2022-06-16 23:31:38 +09:00
parent 7b0fad6461
commit 7809566f16

View File

@ -133,6 +133,9 @@ namespace osu.Game.Database
Task.Factory.StartNew(() =>
{
realm.CreateBackup(Path.Combine(backup_folder, $"client.{backupSuffix}.realm"), realmBlockOperations);
// Above call will dispose of the blocking token when done.
// Clean up here so we don't accidentally dispose twice.
realmBlockOperations = null;
efContextFactory.CreateBackup(Path.Combine(backup_folder, $"client.{backupSuffix}.db"));
@ -220,6 +223,7 @@ namespace osu.Game.Database
// If we were to not do this, the migration would run another time the next time the user starts the game.
deletePreRealmData();
// If something went wrong and the disposal token wasn't invoked above, ensure it is here.
realmBlockOperations?.Dispose();
migrationCompleted.SetResult(true);