Merge pull request #19959 from peppy/fix-slider-path-version-runaway

Fix `SliderPath.Version` bindings not being correctly cleaned up on path changes
This commit is contained in:
Dean Herbert 2022-08-25 16:32:34 +09:00 committed by GitHub
commit a68c71b34f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -142,8 +142,10 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
case NotifyCollectionChangedAction.Remove:
foreach (var point in e.OldItems.Cast<PathControlPoint>())
{
Pieces.RemoveAll(p => p.ControlPoint == point);
Connections.RemoveAll(c => c.ControlPoint == point);
foreach (var piece in Pieces.Where(p => p.ControlPoint == point).ToArray())
piece.RemoveAndDisposeImmediately();
foreach (var connection in Connections.Where(c => c.ControlPoint == point).ToArray())
connection.RemoveAndDisposeImmediately();
}
// If removing before the end of the path,