Prevent overrides from messing with application/freeing

This commit is contained in:
smoogipoo
2020-11-07 00:40:26 +09:00
parent 3a4bd73823
commit b1e039bcec
3 changed files with 49 additions and 28 deletions

View File

@ -78,22 +78,22 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
Tracking.BindValueChanged(updateSlidingSample);
}
public override void Free()
protected override void OnApply(HitObject hitObject)
{
PathVersion.UnbindFrom(HitObject.Path.Version);
base.Free();
}
public override void Apply(HitObject hitObject)
{
base.Apply(hitObject);
base.OnApply(hitObject);
// Ensure that the version will change after the upcoming BindTo().
pathVersion.Value = int.MaxValue;
PathVersion.BindTo(HitObject.Path.Version);
}
protected override void OnFree(HitObject hitObject)
{
base.OnFree(hitObject);
PathVersion.UnbindFrom(HitObject.Path.Version);
}
private PausableSkinnableSound slidingSample;
protected override void LoadSamples()