1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 09:17:51 +08:00

Merge pull request #20258 from peppy/fix-slider-leak-editor

Fix bindable event binds to `HitObject` directly
This commit is contained in:
Dan Balasescu 2022-09-12 19:47:10 +09:00 committed by GitHub
commit 7f291552c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,6 +6,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using JetBrains.Annotations;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Extensions.Color4Extensions;
@ -53,6 +54,9 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
private IBindable<Vector2> sliderPosition;
private IBindable<float> sliderScale;
[UsedImplicitly]
private readonly IBindable<int> sliderVersion;
public PathControlPointPiece(Slider slider, PathControlPoint controlPoint)
{
this.slider = slider;
@ -61,7 +65,8 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
// we don't want to run the path type update on construction as it may inadvertently change the slider.
cachePoints(slider);
slider.Path.Version.BindValueChanged(_ =>
sliderVersion = slider.Path.Version.GetBoundCopy();
sliderVersion.BindValueChanged(_ =>
{
cachePoints(slider);
updatePathType();