Don't let the flattened symbol go out of scope before we're done with it.
Fixes https://gitlab.com/kicad/code/kicad/issues/6760
This commit is contained in:
parent
625e239abf
commit
5761666ad6
|
@ -266,10 +266,14 @@ void DIALOG_CHANGE_SYMBOLS::updateFieldsList()
|
|||
|
||||
if( m_mode == MODE::UPDATE && symbol->GetPartRef() )
|
||||
{
|
||||
symbol->GetPartRef()->Flatten()->GetFields( libFields );
|
||||
std::unique_ptr<LIB_PART> flattenedPart = symbol->GetPartRef()->Flatten();
|
||||
|
||||
flattenedPart->GetFields( libFields );
|
||||
|
||||
for( unsigned i = MANDATORY_FIELDS; i < libFields.size(); ++i )
|
||||
fieldNames.insert( libFields[i]->GetName() );
|
||||
|
||||
libFields.clear(); // flattenedPart is about to go out of scope...
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue