Ensure pin map pointers are valid after pin vector is filled

This commit is contained in:
Jon Evans 2019-04-25 16:04:01 -04:00
parent 0ce32f7be1
commit 3233bedc7a
2 changed files with 6 additions and 5 deletions

View File

@ -445,13 +445,11 @@ void SCH_COMPONENT::UpdatePins( SCH_SHEET_PATH* aSheet )
m_pins.emplace_back( SCH_PIN( libPin, this ) );
}
m_pinMap[ libPin ] = &m_pins[ i ];
if( aSheet )
m_pins[ i ].InitializeConnection( *aSheet );
++i;
}
for( SCH_PIN& pin : m_pins )
m_pinMap[ pin.GetLibPin() ] = &pin;
}
}

View File

@ -68,6 +68,9 @@ SCH_ITEM::~SCH_ITEM()
// are owned by the sheet object container.
if( !m_connections.empty() )
m_connections.clear();
for( const auto& it : m_connection_map )
delete it.second;
}