CONNECTION_GRAPH::Recalculate(): ensure unit and pin list are up to date.

Multi-unit symbols created previously incorrect connections, due to not
up to date or missing data. I also saw crashes due to this not up to date data
Fixes #12149
https://gitlab.com/kicad/code/kicad/issues/12149
This commit is contained in:
jean-pierre charras 2022-08-03 17:21:02 +02:00
parent 16d74a7e42
commit 7441510b3c
1 changed files with 8 additions and 0 deletions

View File

@ -469,6 +469,14 @@ void CONNECTION_GRAPH::Recalculate( const SCH_SHEET_LIST& aSheetList, bool aUnco
{ {
if( item->IsConnectable() && ( aUnconditional || item->IsConnectivityDirty() ) ) if( item->IsConnectable() && ( aUnconditional || item->IsConnectivityDirty() ) )
items.push_back( item ); items.push_back( item );
// Ensure the hierarchy info stored in SCREENS is built and up to date
// (multi-unit symbols and pin mapping)
if( item->Type() == SCH_SYMBOL_T )
{
SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( item );
symbol->UpdateUnit( symbol->GetUnitSelection( &sheet ) );
}
} }
m_items.reserve( m_items.size() + items.size() ); m_items.reserve( m_items.size() + items.size() );