Fix for several memory leaks in fluidsim (found with Valgrind).
authorDaniel Genrich <daniel.genrich@gmx.net>
Fri, 11 Jul 2008 18:08:25 +0000 (18:08 +0000)
committerDaniel Genrich <daniel.genrich@gmx.net>
Fri, 11 Jul 2008 18:08:25 +0000 (18:08 +0000)
intern/elbeem/intern/ntl_geometryclass.h
intern/elbeem/intern/ntl_ray.h
intern/elbeem/intern/simulation_object.cpp
intern/elbeem/intern/solver_control.cpp
intern/elbeem/intern/solver_init.cpp

index 9282371d1836707b759a62ca38493aacc63fc7c0..545f8c1d54f57caccfbcedd51a0d99283d2534a3 100644 (file)
@@ -37,6 +37,7 @@ class ntlGeometryClass
                //! Default destructor
                virtual ~ntlGeometryClass() {
                        delete mpAttrs; 
+                       delete mpSwsAttrs;
                };
 
                //! Return type id
index 096d5fd61d3c24599ff7bc1a89fe6bb76a746f64..9b77fdcae281f7ca68e85c97d09d4b8effcb31ef 100644 (file)
@@ -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) { 
index 9b47ae696afff4a2d784e0a00f23406d59034da1..81e056771fc920df1850543117c7a996b40f644c 100644 (file)
@@ -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);
 }
 
index 3dc9b700ccbe8aa2cf7e00a0cda966287d113cba..ee032f17f8a3885e596767136695da18cb6bb92a 100644 (file)
@@ -63,6 +63,9 @@ LbmControlData::LbmControlData() :
 
 LbmControlData::~LbmControlData() 
 {
+       while (!mCons.empty()) {
+               delete mCons.back();  mCons.pop_back();
+       }
 }
 
 
index cbcc99dd6e0f330b75cb61feaacd3f7edf617c1b..fd7a0b6be2c1543c2f855b392bce079fa3fe6238 100644 (file)
@@ -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);