From 61c2bf7ebe10aa8c1d66653fb8e92f74b315f619 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 3 Jan 2018 13:34:08 +0900 Subject: [PATCH] Fix TestCasePerformancePoints binding to global beatmap and never unbinding --- osu.Game/Tests/Visual/TestCasePerformancePoints.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/osu.Game/Tests/Visual/TestCasePerformancePoints.cs b/osu.Game/Tests/Visual/TestCasePerformancePoints.cs index 8984fc843f..8b93be9bb5 100644 --- a/osu.Game/Tests/Visual/TestCasePerformancePoints.cs +++ b/osu.Game/Tests/Visual/TestCasePerformancePoints.cs @@ -7,6 +7,7 @@ using OpenTK; using OpenTK.Graphics; using osu.Framework.Allocation; using osu.Framework.Caching; +using osu.Framework.Configuration; using osu.Framework.Extensions.IEnumerableExtensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; @@ -203,6 +204,8 @@ namespace osu.Game.Tests.Visual private readonly FillFlowContainer scores; private APIAccess api; + private readonly Bindable currentBeatmap = new Bindable(); + public PerformanceList() { RelativeSizeAxes = Axes.X; @@ -231,12 +234,15 @@ namespace osu.Game.Tests.Visual }; } - osuGame.Beatmap.ValueChanged += beatmapChanged; + currentBeatmap.ValueChanged += beatmapChanged; + currentBeatmap.BindTo(osuGame.Beatmap); } private GetScoresRequest lastRequest; private void beatmapChanged(WorkingBeatmap newBeatmap) { + if (!IsAlive) return; + lastRequest?.Cancel(); scores.Clear();