TD: fix memory leaks with raw pointers of GeometryObject

Replacing the use of raw pointers of GeometryObject with shared pointers fixes the observed memory leaks when running the unit tests of TechDraw
This commit is contained in:
wmayer
2022-11-15 11:09:12 +01:00
committed by WandererFan
parent a9283c9945
commit 9e9c784041
6 changed files with 22 additions and 23 deletions

View File

@@ -40,6 +40,7 @@ class gp_Ax2;
namespace TechDraw
{
class GeometryObject;
using GeometryObjectPtr = std::shared_ptr<GeometryObject>;
class Vertex;
class BaseGeom;
}
@@ -98,7 +99,7 @@ public:
public:
static std::vector<TopoDS_Edge> getEdgesForWalker(TopoDS_Shape shape, double scale, Base::Vector3d direction);
static TechDraw::GeometryObject* buildGeometryObject(TopoDS_Shape shape, const gp_Ax2& viewAxis);
static TechDraw::GeometryObjectPtr buildGeometryObject(TopoDS_Shape shape, const gp_Ax2& viewAxis);
static bool isOnEdge(TopoDS_Edge e, TopoDS_Vertex v, double& param, bool allowEnds = false);
static std::vector<TopoDS_Edge> splitEdges(std::vector<TopoDS_Edge> orig, std::vector<splitPoint> splits);