From e3988b446abc7a705b29f656916ef4aeb5ce3255 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Tue, 18 Aug 2020 04:06:26 -0700 Subject: [PATCH] Adjust pointer duplication logic --- utils/kicad2step/pcb/kicadpcb.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/utils/kicad2step/pcb/kicadpcb.cpp b/utils/kicad2step/pcb/kicadpcb.cpp index c6f8acb527..ecfa26c887 100644 --- a/utils/kicad2step/pcb/kicadpcb.cpp +++ b/utils/kicad2step/pcb/kicadpcb.cpp @@ -396,22 +396,22 @@ bool KICADPCB::parseRect( SEXPR::SEXPR* data ) return true; } - KICADCURVE* top( mp ); - KICADCURVE* right( mp ); - KICADCURVE* bottom( mp ); - KICADCURVE* left( mp ); + KICADCURVE* top = new KICADCURVE( *mp ); + KICADCURVE* right = new KICADCURVE( *mp ); + KICADCURVE* bottom = new KICADCURVE( *mp ); + KICADCURVE* left = new KICADCURVE( *mp ); delete mp; - top->m_end.y = top->m_start.y; + top->m_end.y = right->m_start.y; m_curves.push_back( top ); - right->m_start.x = right->m_end.x; + right->m_start.x = bottom->m_end.x; m_curves.push_back( right ); - bottom->m_start.y = bottom->m_end.y; + bottom->m_start.y = left->m_end.y; m_curves.push_back( bottom ); - left->m_end.x = left->m_start.x; + left->m_end.x = top->m_start.x; m_curves.push_back( left ); return true;