1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-13 17:33:22 +08:00

Fix SliderPath.Version bindings not being correctly cleaned up on path changes

This commit is contained in:
Dean Herbert 2022-08-25 15:00:32 +09:00
parent 136dcee3b5
commit 091c51e664

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))
piece.RemoveAndDisposeImmediately();
foreach (var connection in Connections.Where(c => c.ControlPoint == point))
connection.RemoveAndDisposeImmediately();
}
// If removing before the end of the path,