diff --git a/pcbnew/tools/pcb_point_editor.cpp b/pcbnew/tools/pcb_point_editor.cpp index 17310566d0..5e9d3d0107 100644 --- a/pcbnew/tools/pcb_point_editor.cpp +++ b/pcbnew/tools/pcb_point_editor.cpp @@ -2418,7 +2418,7 @@ int PCB_POINT_EDITOR::addCorner( const TOOL_EVENT& aEvent ) graphicItem->SetEnd( VECTOR2I( nearestPoint.x, nearestPoint.y ) ); // and add another one starting from the break point - PCB_SHAPE* newSegment = new PCB_SHAPE( *graphicItem ); + PCB_SHAPE* newSegment = static_cast( graphicItem->Duplicate() ); newSegment->ClearSelected(); newSegment->SetStart( VECTOR2I( nearestPoint.x, nearestPoint.y ) );