diff --git a/extlib/libdxfrw b/extlib/libdxfrw index 0b7b7b709..8359399ff 160000 --- a/extlib/libdxfrw +++ b/extlib/libdxfrw @@ -1 +1 @@ -Subproject commit 0b7b7b709d9299565db603f878214656ef5e9ddf +Subproject commit 8359399ff3eb96aec14fb160c9a5bc4796b60717 diff --git a/src/exportvector.cpp b/src/exportvector.cpp index 55abac685..e9dad60f0 100644 --- a/src/exportvector.cpp +++ b/src/exportvector.cpp @@ -134,9 +134,9 @@ class DxfWriteInterface : public DRW_Interface { polyline.flags |= 8 /* 3d polyline */; } polyline.vertlist.push_back( - new DRW_Vertex(start->pos.x, start->pos.y, start->pos.z, 0.0)); + std::make_shared(start->pos.x, start->pos.y, start->pos.z, 0.0)); polyline.vertlist.push_back( - new DRW_Vertex(next->pos.x, next->pos.y, next->pos.z, 0.0)); + std::make_shared(next->pos.x, next->pos.y, next->pos.z, 0.0)); }; auto nextFunc = [&](PolylineBuilder::Vertex *next, PolylineBuilder::Edge *e) { @@ -144,7 +144,7 @@ class DxfWriteInterface : public DRW_Interface { polyline.flags |= 8 /* 3d polyline */; } polyline.vertlist.push_back( - new DRW_Vertex(next->pos.x, next->pos.y, next->pos.z, 0.0)); + std::make_shared(next->pos.x, next->pos.y, next->pos.z, 0.0)); }; auto endFunc = [&]() { @@ -370,8 +370,7 @@ class DxfWriteInterface : public DRW_Interface { assignEntityDefaults(&polyline, hs); for(int i = 0; i < lv.n; i++) { Vector *v = &lv[i]; - DRW_Vertex *vertex = new DRW_Vertex(v->x, v->y, v->z, 0.0); - polyline.vertlist.push_back(vertex); + polyline.vertlist.push_back(std::make_shared(v->x, v->y, v->z, 0.0)); } dxf->writePolyline(&polyline); lv.Clear(); @@ -411,7 +410,7 @@ class DxfWriteInterface : public DRW_Interface { makeKnotsFor(&spline); for(int i = 0; i <= sb->deg; i++) { spline.controllist.push_back( - new DRW_Coord(sb->ctrl[i].x, sb->ctrl[i].y, sb->ctrl[i].z)); + std::make_shared(sb->ctrl[i].x, sb->ctrl[i].y, sb->ctrl[i].z)); if(isRational) spline.weightlist.push_back(sb->weight[i]); } dxf->writeSpline(&spline);