diff --git a/osu.Game.Rulesets.Osu/Skinning/GameplayAccuracyHeatmap.cs b/osu.Game.Rulesets.Osu/Skinning/GameplayAccuracyHeatmap.cs index 485cc243ca..10aaa1d962 100644 --- a/osu.Game.Rulesets.Osu/Skinning/GameplayAccuracyHeatmap.cs +++ b/osu.Game.Rulesets.Osu/Skinning/GameplayAccuracyHeatmap.cs @@ -51,6 +51,16 @@ namespace osu.Game.Rulesets.Osu.Skinning scoreProcessor.NewJudgement += updateHeatmap; } + protected override void Dispose(bool isDisposing) + { + base.Dispose(isDisposing); + + if (gameplayClockContainer != null) + gameplayClockContainer.OnSeek -= initHeatmap; + + scoreProcessor.NewJudgement -= updateHeatmap; + } + private void initHeatmap() { ScoreInfo scoreInfo = new ScoreInfo { BeatmapInfo = beatmap.Value.BeatmapInfo, HitEvents = (List)scoreProcessor.HitEvents }; diff --git a/osu.Game.Rulesets.Osu/Statistics/AccuracyHeatmap.cs b/osu.Game.Rulesets.Osu/Statistics/AccuracyHeatmap.cs index c6f6bc242f..f85062bdc3 100644 --- a/osu.Game.Rulesets.Osu/Statistics/AccuracyHeatmap.cs +++ b/osu.Game.Rulesets.Osu/Statistics/AccuracyHeatmap.cs @@ -39,7 +39,7 @@ namespace osu.Game.Rulesets.Osu.Statistics private const float rotation = 45; private BufferedContainer bufferedGrid = null!; - private GridContainer? pointGrid; + private GridContainer pointGrid = null!; private readonly ScoreInfo score; private readonly IBeatmap playableBeatmap; @@ -234,7 +234,7 @@ namespace osu.Game.Rulesets.Osu.Statistics public void AddPoint(Vector2 start, Vector2 end, Vector2 hitPoint, float radius) { - if (pointGrid == null || pointGrid.Content.Count == 0) + if (pointGrid.Content.Count == 0) return; double angle1 = Math.Atan2(end.Y - hitPoint.Y, hitPoint.X - end.X); // Angle between the end point and the hit point.