From 0603be5937e1820e63a0929f9f48dc2f74da6016 Mon Sep 17 00:00:00 2001 From: MrTheMake Date: Tue, 23 May 2017 15:30:15 +0200 Subject: [PATCH 1/3] Unregister OnBeatmapChanged() when exiting song selection --- osu.Game/Screens/OsuScreen.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/OsuScreen.cs b/osu.Game/Screens/OsuScreen.cs index 6a0e37ca6f..162a22ab61 100644 --- a/osu.Game/Screens/OsuScreen.cs +++ b/osu.Game/Screens/OsuScreen.cs @@ -131,7 +131,12 @@ namespace osu.Game.Screens Background.Exit(); } - return base.OnExiting(next); + if (base.OnExiting(next)) + return true; + + beatmap.ValueChanged -= OnBeatmapChanged; + + return false; } } } From b61452024ac664031f85288d8e738b4305d9c2f1 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 31 May 2017 11:02:26 +0900 Subject: [PATCH 2/3] Add comment --- osu.Game/Screens/OsuScreen.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Game/Screens/OsuScreen.cs b/osu.Game/Screens/OsuScreen.cs index 162a22ab61..3d8ead0fbb 100644 --- a/osu.Game/Screens/OsuScreen.cs +++ b/osu.Game/Screens/OsuScreen.cs @@ -134,6 +134,8 @@ namespace osu.Game.Screens if (base.OnExiting(next)) return true; + // while this is not necessary as we are constructing our own bindable, there are cases where + // the GC doesn't run as fast as expected and this is triggered post-exit. beatmap.ValueChanged -= OnBeatmapChanged; return false; From 61fb5d6ac8dee8818282b4d341e8535c819430a6 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 31 May 2017 11:04:18 +0900 Subject: [PATCH 3/3] Add issue URL to comment --- osu.Game/Screens/OsuScreen.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Screens/OsuScreen.cs b/osu.Game/Screens/OsuScreen.cs index 3d8ead0fbb..de9c698f2a 100644 --- a/osu.Game/Screens/OsuScreen.cs +++ b/osu.Game/Screens/OsuScreen.cs @@ -136,6 +136,7 @@ namespace osu.Game.Screens // while this is not necessary as we are constructing our own bindable, there are cases where // the GC doesn't run as fast as expected and this is triggered post-exit. + // added to resolve https://github.com/ppy/osu/issues/829 beatmap.ValueChanged -= OnBeatmapChanged; return false;