From fdae9f0b75a3ba9581c50b9f0e266b6ab5bd875a Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Thu, 19 Oct 2017 14:09:58 -0700 Subject: [PATCH] pcbnew: Only remove one duplicate track -- not both Fixes: lp:1724728 * https://bugs.launchpad.net/kicad/+bug/1724728 --- pcbnew/clean.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pcbnew/clean.cpp b/pcbnew/clean.cpp index 05c34ea941..5e52049d1c 100644 --- a/pcbnew/clean.cpp +++ b/pcbnew/clean.cpp @@ -444,6 +444,8 @@ bool TRACKS_CLEANER::deleteNullSegments() void TRACKS_CLEANER::removeDuplicatesOfTrack( const TRACK *aTrack, std::set& aToRemove ) { + if( aTrack->GetFlags() & STRUCT_DELETED ) + return; for( auto other : m_brd->Tracks() ) { @@ -454,6 +456,9 @@ void TRACKS_CLEANER::removeDuplicatesOfTrack( const TRACK *aTrack, std::setGetFlags() & STRUCT_DELETED ) + continue; + // Must be of the same type, on the same layer and the endpoints // must be the same (maybe swapped) if( ( aTrack->Type() == other->Type() ) && @@ -464,6 +469,7 @@ void TRACKS_CLEANER::removeDuplicatesOfTrack( const TRACK *aTrack, std::setGetStart() == other->GetEnd() ) && ( aTrack->GetEnd() == other->GetStart() ) ) ) { + other->SetFlags( STRUCT_DELETED ); aToRemove.insert( other ); } }