Fix crash in libedit when moving/editing pins in synchronised mode
Unit numbers start at 1, not 0. Our vector needs to be size + 1 if we want to use the unit number as an index. 0 is reserved for "all units"
This commit is contained in:
parent
b2db24f275
commit
c5cdda26ae
|
@ -275,7 +275,7 @@ int SYMBOL_EDITOR_EDIT_TOOL::DoDelete( const TOOL_EVENT& aEvent )
|
|||
// in different units are also removed. But only one pin per unit (matching)
|
||||
if( m_frame->SynchronizePins() )
|
||||
{
|
||||
std::vector<bool> got_unit( symbol->GetUnitCount() );
|
||||
std::vector<bool> got_unit( symbol->GetUnitCount() + 1 );
|
||||
|
||||
got_unit[pin->GetUnit()] = true;
|
||||
|
||||
|
|
|
@ -156,7 +156,7 @@ int SYMBOL_EDITOR_MOVE_TOOL::Main( const TOOL_EVENT& aEvent )
|
|||
{
|
||||
LIB_PIN* cur_pin = static_cast<LIB_PIN*>( lib_item );
|
||||
LIB_SYMBOL* symbol = m_frame->GetCurSymbol();
|
||||
std::vector<bool> got_unit( symbol->GetUnitCount() );
|
||||
std::vector<bool> got_unit( symbol->GetUnitCount() + 1 );
|
||||
|
||||
got_unit[cur_pin->GetUnit()] = true;
|
||||
|
||||
|
|
Loading…
Reference in New Issue