correct freeing C++ arrays.
authorCampbell Barton <ideasman42@gmail.com>
Sun, 10 Jun 2012 20:14:15 +0000 (20:14 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 10 Jun 2012 20:14:15 +0000 (20:14 +0000)
intern/smoke/intern/WTURBULENCE.cpp
source/blender/compositor/operations/COM_ConvolutionFilterOperation.cpp
source/blender/compositor/operations/COM_DoubleEdgeMaskOperation.cpp

index 83bec466c9f9b4673480c73900e127d6df35a8e0..671198065e8af0bb389dc1b6294ed36c9d56a1fb 100644 (file)
@@ -511,7 +511,7 @@ void WTURBULENCE::computeEnergy(float *_energy, float* xvel, float* yvel, float*
         if (obstacles[index])
           obstacles[index] = 1; // DG TODO ? animated obstacle flag?
 
-  free(obstacles);
+  delete [] obstacles;
 }
 
 //////////////////////////////////////////////////////////////////////////////////////////
index 9fec75abafee3d9ea2f3e9e59f45ae0f6e40088a..2720a0a414626ffe37793870bda61c10def31ac3 100644 (file)
@@ -61,7 +61,7 @@ void ConvolutionFilterOperation::deinitExecution()
        this->inputOperation = NULL;
        this->inputValueOperation = NULL;
        if (this->filter) {
-               delete this->filter;
+               delete [] this->filter;
                this->filter = NULL;
        }
 }
index 9e911e7ba40ee6f09505fbeaf7f5db8caa850b7a..40f492b0f10394ccaeed4ea72b512b2781c4b037 100644 (file)
@@ -1220,7 +1220,7 @@ void DoubleEdgeMaskOperation::doDoubleEdgeMask(float *imask, float *omask, float
                do_createEdgeLocationBuffer(t,rw,lres,res,gbuf,&innerEdgeOffset,&outerEdgeOffset,isz,gsz);
                do_fillGradientBuffer(rw,res,gbuf,isz,osz,gsz,innerEdgeOffset,outerEdgeOffset);
                
-               delete gbuf;          // free the gradient index buffer
+               delete [] gbuf;          // free the gradient index buffer
        }
 }