Python code like: for track in board.GetTracks(): board.Remove(track) Would delete tracks in the the underlying m_tracks while iterating over it. Fixes https://gitlab.com/kicad/code/kicad/-/issues/5192