mirror of
https://github.com/ppy/osu
synced 2025-01-19 20:40:52 +00:00
Fix threaded realm usage not disposing context fast enough
This commit is contained in:
parent
34d60b9e10
commit
8fb9aec730
@ -59,15 +59,21 @@ namespace osu.Game.Rulesets.Configuration
|
||||
pendingWrites.Clear();
|
||||
}
|
||||
|
||||
realmFactory?.CreateContext().Write(realm =>
|
||||
{
|
||||
foreach (var c in changed)
|
||||
{
|
||||
var setting = realm.All<RealmRulesetSetting>().First(s => s.RulesetID == rulesetId && s.Variant == variant && s.Key == c.ToString());
|
||||
if (realmFactory == null)
|
||||
return true;
|
||||
|
||||
setting.Value = ConfigStore[c].ToString();
|
||||
}
|
||||
});
|
||||
using (var context = realmFactory.CreateContext())
|
||||
{
|
||||
context.Write(realm =>
|
||||
{
|
||||
foreach (var c in changed)
|
||||
{
|
||||
var setting = realm.All<RealmRulesetSetting>().First(s => s.RulesetID == rulesetId && s.Variant == variant && s.Key == c.ToString());
|
||||
|
||||
setting.Value = ConfigStore[c].ToString();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user