From 3aaba79b878f34c57e5fa6e879ceafbd55d46240 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sun, 28 Apr 2019 18:41:17 +0100 Subject: [PATCH] Fix crash when unfolding bus. Thanks to Julien Faucher for the investigation into the problem. --- eeschema/tools/sch_drawing_tool.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/eeschema/tools/sch_drawing_tool.cpp b/eeschema/tools/sch_drawing_tool.cpp index cf3a4a93be..26654795bb 100644 --- a/eeschema/tools/sch_drawing_tool.cpp +++ b/eeschema/tools/sch_drawing_tool.cpp @@ -954,17 +954,9 @@ int SCH_DRAWING_TOOL::doDrawSegments( int aType, SCH_LINE* aSegment ) m_frame->AddToScreen( m_busUnfold.label ); m_busUnfold.label_placed = true; - - aSegment->ClearFlags( IS_NEW ); - aSegment->SetFlags( SELECTED ); - - aSegment = new SCH_LINE( *aSegment ); - aSegment->SetFlags( IS_NEW ); - aSegment->SetStartPoint( cursorPos ); - s_wires.PushBack( aSegment ); - screen->SetCurItem( aSegment ); } - else if( !aSegment ) + + if( !aSegment ) { aSegment = startSegments( aType, cursorPos ); }