CADSTAR Schematic: Fix crash when trying to fix library pins

Need to copy the chain as we might have deleted it.
This commit is contained in:
Roberto Fernandez Bautista 2021-10-17 13:43:01 +01:00
parent 4d5a344ed5
commit d6d800ccbb
1 changed files with 2 additions and 1 deletions

View File

@ -2840,7 +2840,7 @@ void CADSTAR_SCH_ARCHIVE_LOADER::fixUpLibraryPins( LIB_SYMBOL* aSymbolToFix, int
bool isUnique = true;
auto removeSegment =
[&]( SHAPE_LINE_CHAIN& aLineToRemove )
[&]( SHAPE_LINE_CHAIN aLineToRemove )
{
uniqueSegments.erase( aLineToRemove.CPoint( 0 ) );
uniqueSegments.erase( aLineToRemove.CPoint( 1 ) );
@ -2860,6 +2860,7 @@ void CADSTAR_SCH_ARCHIVE_LOADER::fixUpLibraryPins( LIB_SYMBOL* aSymbolToFix, int
if( isUnique && pt0 != pt1 )
{
// we are only interested in vertical or horizontal segments
if( pt0.x == pt1.x || pt0.y == pt1.y )
{
uniqueSegments.insert( { poly.CPoint( 0 ), poly } );