Merge pull request #9530 from peppy/fix-memory-retention

Clean up HitEvents after use to avoid near-permanent memory retention
This commit is contained in:
Dean Herbert 2020-07-12 01:27:38 +09:00 committed by GitHub
commit fda45997db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -252,6 +252,12 @@ namespace osu.Game.Rulesets.Scoring
HighestCombo.Value = 0;
}
protected override void Dispose(bool isDisposing)
{
base.Dispose(isDisposing);
hitEvents.Clear();
}
/// <summary>
/// Retrieve a score populated with data for the current play this processor is responsible for.
/// </summary>
@ -269,7 +275,7 @@ namespace osu.Game.Rulesets.Scoring
foreach (var result in Enum.GetValues(typeof(HitResult)).OfType<HitResult>().Where(r => r > HitResult.None && hitWindows.IsHitResultAllowed(r)))
score.Statistics[result] = GetStatistic(result);
score.HitEvents = new List<HitEvent>(hitEvents);
score.HitEvents = hitEvents;
}
/// <summary>