From d6d800ccbb146bf7d7fd3a5366c51447241883f9 Mon Sep 17 00:00:00 2001 From: Roberto Fernandez Bautista Date: Sun, 17 Oct 2021 13:43:01 +0100 Subject: [PATCH] CADSTAR Schematic: Fix crash when trying to fix library pins Need to copy the chain as we might have deleted it. --- eeschema/sch_plugins/cadstar/cadstar_sch_archive_loader.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eeschema/sch_plugins/cadstar/cadstar_sch_archive_loader.cpp b/eeschema/sch_plugins/cadstar/cadstar_sch_archive_loader.cpp index bf24c316c8..4edb140968 100644 --- a/eeschema/sch_plugins/cadstar/cadstar_sch_archive_loader.cpp +++ b/eeschema/sch_plugins/cadstar/cadstar_sch_archive_loader.cpp @@ -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 } );