Fix bug in pruning of selection.

Fixes: lp:1770939
* https://bugs.launchpad.net/kicad/+bug/1770939
This commit is contained in:
Jeff Young 2018-05-13 15:22:45 +01:00
parent c30dd24cc1
commit a9dc417319
1 changed files with 4 additions and 2 deletions

View File

@ -382,8 +382,7 @@ SELECTION& SELECTION_TOOL::RequestSelection( int aFlags, CLIENT_SELECTION_FILTER
m_selection.ClearReferencePoint();
}
// Be careful with iterators: items can be removed from list
// that invalidate iterators.
// Be careful with iterators: items can be removed from list that invalidate iterators.
for( unsigned ii = 0; ii < m_selection.GetSize(); ii++ )
{
EDA_ITEM* item = m_selection[ii];
@ -391,6 +390,9 @@ SELECTION& SELECTION_TOOL::RequestSelection( int aFlags, CLIENT_SELECTION_FILTER
if( ( aFlags & SELECTION_EDITABLE ) && item->Type() == PCB_MARKER_T )
{
unselect( static_cast<BOARD_ITEM *>( item ) );
// unselect() removed the item from list. Back up to catch the following item.
ii--;
}
}