msvc: Use source folder structure for project file.
[blender.git] / intern / elbeem / intern / solver_control.cpp
index 15b9468ed0d0e66e5358bad19df0f7a23e29fba9..c3015b82f0a739c5342da5a435dfdd92e0630bee 100644 (file)
@@ -1,3 +1,6 @@
+/** \file elbeem/intern/solver_control.cpp
+ *  \ingroup elbeem
+ */
 /******************************************************************************
  *
  * El'Beem - the visual lattice boltzmann freesurface simulator
@@ -222,7 +225,10 @@ LbmFsgrSolver::initCpdata()
        
        // manually switch on! if this is zero, nothing is done...
        mpControl->mSetForceStrength = this->mTForceStrength = 1.;
-       mpControl->mCons.clear();
+       while (!mpControl->mCons.empty()) {
+               delete mpControl->mCons.back();  mpControl->mCons.pop_back();
+       }
+
        
        // init all control fluid objects
        int numobjs = (int)(mpGiObjects->size());
@@ -261,7 +267,9 @@ LbmFsgrSolver::initCpdata()
        if(0) {
                // manually switch on! if this is zero, nothing is done...
                mpControl->mSetForceStrength = this->mTForceStrength = 1.;
-               mpControl->mCons.clear();
+               while (!mpControl->mCons.empty()) {
+                       delete mpControl->mCons.back();  mpControl->mCons.pop_back();
+               }
 
                // add new set
                LbmControlSet *cset;
@@ -420,6 +428,10 @@ LbmFsgrSolver::handleCpdata()
                return;
        }
        
+       // check if we have control objects
+       if(mpControl->mCons.size()==0)
+               return;
+       
        if((mpControl->mCpUpdateInterval<1) || (this->mStepCnt%mpControl->mCpUpdateInterval==0)) {
                // do full reinit later on... 
        }