[TD] avoid memory leaks by using shared_ptr

TD geometry objects are sometimes double deleted.  This
change uses shared_ptr instead of raw pointers to manage
deletions.
This commit is contained in:
Wanderer Fan
2022-01-02 10:12:56 -05:00
committed by WandererFan
parent ad2169e5ae
commit 28c5890bc9
34 changed files with 290 additions and 279 deletions

View File

@@ -253,9 +253,9 @@ void TaskCosmeticLine::updateCosmeticLine(void)
gp_Pnt gp1(p0.x, p0.y, p0.z);
gp_Pnt gp2(p1.x, p1.y, p1.z);
TopoDS_Edge e = BRepBuilderAPI_MakeEdge(gp1, gp2);
auto oldGeom = m_ce->m_geometry;
// auto oldGeom = m_ce->m_geometry;
m_ce->m_geometry = TechDraw::BaseGeom::baseFactory(e);
delete oldGeom;
// delete oldGeom;
// Gui::Command::updateActive();
// Gui::Command::commitCommand();