Fix OsuScreenDependencies not caching non-leased versions

This commit is contained in:
Dean Herbert 2019-12-13 20:05:54 +09:00
parent 952bc96bbf
commit 395b058ff8
1 changed files with 10 additions and 0 deletions

View File

@ -26,16 +26,26 @@ public OsuScreenDependencies(bool requireLease, IReadOnlyDependencyContainer par
Beatmap = parent.Get<LeasedBindable<WorkingBeatmap>>()?.GetBoundCopy();
if (Beatmap == null)
{
Cache(Beatmap = parent.Get<Bindable<WorkingBeatmap>>().BeginLease(false));
CacheAs(Beatmap);
}
Ruleset = parent.Get<LeasedBindable<RulesetInfo>>()?.GetBoundCopy();
if (Ruleset == null)
{
Cache(Ruleset = parent.Get<Bindable<RulesetInfo>>().BeginLease(true));
CacheAs(Ruleset);
}
Mods = parent.Get<LeasedBindable<IReadOnlyList<Mod>>>()?.GetBoundCopy();
if (Mods == null)
{
Cache(Mods = parent.Get<Bindable<IReadOnlyList<Mod>>>().BeginLease(true));
CacheAs(Mods);
}
}
else
{