Fix for several memory leaks in fluidsim (found with Valgrind).

This commit is contained in:
Daniel Genrich 2008-07-11 18:08:25 +00:00
parent c83e32fc33
commit b369936b11
5 changed files with 13 additions and 3 deletions

@ -37,6 +37,7 @@ class ntlGeometryClass
//! Default destructor
virtual ~ntlGeometryClass() {
delete mpAttrs;
delete mpSwsAttrs;
};
//! Return type id

@ -20,6 +20,7 @@ class ntlRay;
class ntlTree;
class ntlScene;
class ntlRenderGlobals;
class ntlGeometryObject;
//! store data for an intersection of a ray and a triangle
// NOT YET USED
@ -323,8 +324,8 @@ public:
/* CONSTRUCTORS */
/*! Default constructor */
ntlScene( ntlRenderGlobals *glob, bool del=true );
/*! Default destructor */
~ntlScene();
/*! Default destructor */
~ntlScene();
/*! Add an object to the scene */
inline void addGeoClass(ntlGeometryClass *geo) {

@ -58,7 +58,8 @@ SimulationObject::~SimulationObject()
if(mpGiTree) delete mpGiTree;
if(mpElbeemSettings) delete mpElbeemSettings;
if(mpLbm) delete mpLbm;
if(mpParam) delete mpParam;
if(mpParam) delete mpParam;
if(mpParts) delete mpParts;
debMsgStd("SimulationObject",DM_MSG,"El'Beem Done!\n",10);
}

@ -63,6 +63,9 @@ LbmControlData::LbmControlData() :
LbmControlData::~LbmControlData()
{
while (!mCons.empty()) {
delete mCons.back(); mCons.pop_back();
}
}

@ -441,6 +441,10 @@ LbmFsgrSolver::~LbmFsgrSolver()
delete mpIso;
if(mpPreviewSurface) delete mpPreviewSurface;
// cleanup done during scene deletion...
#if LBM_INCLUDE_CONTROL==1
if(mpControl) delete mpControl;
#endif
// always output performance estimate
debMsgStd("LbmFsgrSolver::~LbmFsgrSolver",DM_MSG," Avg. MLSUPS:"<<(mAvgMLSUPS/mAvgMLSUPSCnt), 5);