Why need not to delete arc_curve in this example ?
Write like this,
...
delete curve_object;
}
}
delete arc_curve
Official example:
ON_3dPoint center(0.0, 0.0, 0.0);
double radius = 10.0;
ON_Circle circle( center, radius );
ON_ArcCurve* arc_curve = new ON_ArcCurve( circle );
if( arc_curve )
{
CRhinoCurveObject* curve_object = new CRhinoCurveObject();
if( curve_object )
{
// Set the curve to the curve object. Note,
// curve_object will delete arc_curve.
curve_object->SetCurve( arc_curve );
if( context.m_doc.AddObject(curve_object) )
context.m_doc.Redraw();
else
delete curve_object;
}
}