Adjust pointer duplication logic

This commit is contained in:
Seth Hillbrand 2020-08-18 04:06:26 -07:00
parent 3b9c47a1be
commit e3988b446a
1 changed files with 8 additions and 8 deletions

View File

@ -396,22 +396,22 @@ bool KICADPCB::parseRect( SEXPR::SEXPR* data )
return true; return true;
} }
KICADCURVE* top( mp ); KICADCURVE* top = new KICADCURVE( *mp );
KICADCURVE* right( mp ); KICADCURVE* right = new KICADCURVE( *mp );
KICADCURVE* bottom( mp ); KICADCURVE* bottom = new KICADCURVE( *mp );
KICADCURVE* left( mp ); KICADCURVE* left = new KICADCURVE( *mp );
delete mp; delete mp;
top->m_end.y = top->m_start.y; top->m_end.y = right->m_start.y;
m_curves.push_back( top ); 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 ); 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 ); 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 ); m_curves.push_back( left );
return true; return true;