Fix: if a part description has a problem in a library, Eeschema crashes due to a double deletion.

This commit is contained in:
jean-pierre charras 2017-02-27 16:13:16 +01:00
parent 799c8b6922
commit f35cb6cd6a
1 changed files with 2 additions and 3 deletions

View File

@ -2393,9 +2393,6 @@ LIB_PART* SCH_LEGACY_PLUGIN_CACHE::loadPart( FILE_LINE_READER& aReader )
if( !part->HasAlias( part->GetName() ) )
part->AddAlias( part->GetName() );
// Add the root alias to the cache alias list.
m_aliases[ part->GetName() ] = part->GetAlias( part->GetName() );
LIB_FIELD& reference = part->GetReferenceField();
if( prefix == "~" )
@ -2461,6 +2458,8 @@ LIB_PART* SCH_LEGACY_PLUGIN_CACHE::loadPart( FILE_LINE_READER& aReader )
loadFootprintFilters( part, aReader );
else if( strCompare( "ENDDEF", line, &line ) ) // End of part description
{
// Now all is good, Add the root alias to the cache alias list.
m_aliases[ part->GetName() ] = part->GetAlias( part->GetName() );
return part.release();
}