fixed segfault in selection tool

This commit is contained in:
Tomasz Wlostowski 2016-02-08 15:12:59 +01:00 committed by Maciej Suminski
parent 711607f152
commit 5349eb4179
1 changed files with 8 additions and 0 deletions

View File

@ -313,9 +313,14 @@ const SELECTION& SELECTION_TOOL::GetSelection()
BOARD_ITEM* item = m_selection.Item<BOARD_ITEM>( i );
if( !modifiable( item ) )
{
m_selection.items.RemovePicker( i );
m_selection.group->Remove( item );
}
else
{
++i;
}
}
return m_selection;
@ -746,6 +751,9 @@ int SELECTION_TOOL::findMove( const TOOL_EVENT& aEvent )
void SELECTION_TOOL::clearSelection()
{
if( m_selection.Empty() )
return;
KIGFX::VIEW_GROUP::const_iter it, it_end;
// Restore the initial properties