[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 4c9191d489
commit e91cc8e329
34 changed files with 290 additions and 279 deletions

View File

@@ -91,8 +91,8 @@ TaskCenterLine::TaskCenterLine(TechDraw::DrawViewPart* partFeat,
ui->setupUi(this);
m_geomIndex = DrawUtil::getIndexFromName(m_edgeName);
const std::vector<TechDraw::BaseGeom*> &geoms = partFeat->getEdgeGeometry();
BaseGeom* bg = geoms.at(m_geomIndex);
const TechDraw::BaseGeomPtrVector &geoms = partFeat->getEdgeGeometry();
BaseGeomPtr bg = geoms.at(m_geomIndex);
std::string tag = bg->getCosmeticTag();
m_cl = partFeat->getCenterLine(tag);
if (m_cl == nullptr) { //checked by CommandAnnotate. Should never happen.