mirror of
https://github.com/ppy/osu
synced 2024-12-15 03:16:17 +00:00
Merge pull request #6010 from peppy/fix-config-disposal
Dispose config managers ahead of time to avoid database errors
This commit is contained in:
commit
d1f04639fc
@ -207,6 +207,7 @@ namespace osu.Game
|
||||
FileStore.Cleanup();
|
||||
|
||||
AddInternal(API);
|
||||
AddInternal(RulesetConfigCache);
|
||||
|
||||
GlobalActionContainer globalBinding;
|
||||
|
||||
|
@ -36,5 +36,14 @@ namespace osu.Game.Rulesets
|
||||
|
||||
return configCache.GetOrAdd(ruleset.RulesetInfo.ID.Value, _ => ruleset.CreateConfig(settingsStore));
|
||||
}
|
||||
|
||||
protected override void Dispose(bool isDisposing)
|
||||
{
|
||||
base.Dispose(isDisposing);
|
||||
|
||||
// ensures any potential database operations are finalised before game destruction.
|
||||
foreach (var c in configCache.Values)
|
||||
(c as IDisposable)?.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user