1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 18:53:51 +08:00

Move null to finally

This commit is contained in:
Dean Herbert 2022-06-16 23:37:24 +09:00
parent 7809566f16
commit bf6c6682bc

View File

@ -132,11 +132,16 @@ namespace osu.Game.Database
Task.Factory.StartNew(() => Task.Factory.StartNew(() =>
{ {
realm.CreateBackup(Path.Combine(backup_folder, $"client.{backupSuffix}.realm"), realmBlockOperations); try
{
// Above call will dispose of the blocking token when done. realm.CreateBackup(Path.Combine(backup_folder, $"client.{backupSuffix}.realm"), realmBlockOperations);
// Clean up here so we don't accidentally dispose twice. }
realmBlockOperations = null; finally
{
// 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")); efContextFactory.CreateBackup(Path.Combine(backup_folder, $"client.{backupSuffix}.db"));