[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

@@ -26,6 +26,7 @@
#include <App/PropertyFile.h>
#include <App/FeaturePython.h>
#include "Geometry.h"
#include "DrawTemplate.h"
namespace TechDraw
@@ -67,7 +68,7 @@ public:
virtual unsigned int getMemSize(void) const;
public:
std::vector<TechDraw::BaseGeom *> getGeometry() { return geom; }
std::vector<TechDraw::BaseGeomPtr> getGeometry() { return geom; }
int clearGeometry();
// Template Drawing Methods
@@ -80,7 +81,7 @@ protected:
void onChanged(const App::Property* prop);
protected:
std::vector<TechDraw::BaseGeom *> geom;
std::vector<TechDraw::BaseGeomPtr> geom;
private:
static const char* OrientationEnums[];