From f35cb6cd6af3900b1967f8ef73396b9d9b8bc24c Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Mon, 27 Feb 2017 16:13:16 +0100 Subject: [PATCH] Fix: if a part description has a problem in a library, Eeschema crashes due to a double deletion. --- eeschema/sch_legacy_plugin.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/eeschema/sch_legacy_plugin.cpp b/eeschema/sch_legacy_plugin.cpp index ae2752abd2..d94de18ccc 100644 --- a/eeschema/sch_legacy_plugin.cpp +++ b/eeschema/sch_legacy_plugin.cpp @@ -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(); }