mirror of
https://github.com/ppy/osu.git
synced 2024-11-06 06:57:39 +08:00
Add ToArray()
calls to removal iteration for safety
This commit is contained in:
parent
091c51e664
commit
3ca4bdc087
@ -142,9 +142,9 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
|
||||
case NotifyCollectionChangedAction.Remove:
|
||||
foreach (var point in e.OldItems.Cast<PathControlPoint>())
|
||||
{
|
||||
foreach (var piece in Pieces.Where(p => p.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))
|
||||
foreach (var connection in Connections.Where(c => c.ControlPoint == point).ToArray())
|
||||
connection.RemoveAndDisposeImmediately();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user