From 7bb1a5118e26d761b89e3b7e27a10c5a3c8ffb08 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Fri, 13 Dec 2024 16:39:16 +0900 Subject: [PATCH] Unbind event on disposal --- .../BeatmapListing/BeatmapSearchGeneralFilterRow.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/osu.Game/Overlays/BeatmapListing/BeatmapSearchGeneralFilterRow.cs b/osu.Game/Overlays/BeatmapListing/BeatmapSearchGeneralFilterRow.cs index 66a0a16549..34b7d45a77 100644 --- a/osu.Game/Overlays/BeatmapListing/BeatmapSearchGeneralFilterRow.cs +++ b/osu.Game/Overlays/BeatmapListing/BeatmapSearchGeneralFilterRow.cs @@ -82,7 +82,8 @@ namespace osu.Game.Overlays.BeatmapListing { base.LoadComplete(); - if (recommender != null) recommender.StarRatingUpdated += updateText; + if (recommender != null) + recommender.StarRatingUpdated += updateText; Ruleset.BindValueChanged(_ => updateText(), true); } @@ -102,6 +103,14 @@ namespace osu.Game.Overlays.BeatmapListing else Text.Text = Value.GetLocalisableDescription(); } + + protected override void Dispose(bool isDisposing) + { + base.Dispose(isDisposing); + + if (recommender != null) + recommender.StarRatingUpdated -= updateText; + } } private partial class FeaturedArtistsTabItem : MultipleSelectionFilterTabItem