From 40cd998f997508a7f03f58d3d0d32c1283fb84ed Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 23 Nov 2021 18:13:05 +0900 Subject: [PATCH] Fix incorrect disposal --- osu.Game/Database/RealmContextFactory.cs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/osu.Game/Database/RealmContextFactory.cs b/osu.Game/Database/RealmContextFactory.cs index 3949494766..d0d176c780 100644 --- a/osu.Game/Database/RealmContextFactory.cs +++ b/osu.Game/Database/RealmContextFactory.cs @@ -269,14 +269,8 @@ namespace osu.Game.Database } } - private string? getRulesetShortNameFromLegacyID(long rulesetId) - { - if (efContextFactory == null) - return null; - - using (var efContext = efContextFactory.Get()) - return efContext.RulesetInfo.First(r => r.ID == rulesetId)?.ShortName; - } + private string? getRulesetShortNameFromLegacyID(long rulesetId) => + efContextFactory?.Get().RulesetInfo.First(r => r.ID == rulesetId)?.ShortName; /// /// Flush any active contexts and block any further writes.