Ensure pin map pointers are valid after pin vector is filled
This commit is contained in:
parent
0ce32f7be1
commit
3233bedc7a
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue