diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-08-16 16:32:48 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-08-16 16:32:48 +0400 |
commit | 3bc16fd60dd573f8289552a0046b0735d1c7e02b (patch) | |
tree | 3936a357fd922e96b622f29f04804b20cb11f234 /source/blender/compositor/operations/COM_VectorBlurOperation.cpp | |
parent | 883e9df1ccdaaa847c86e2d1457fd88333b87c84 (diff) |
compositor: replace C++ new/delete with guardedalloc.
Diffstat (limited to 'source/blender/compositor/operations/COM_VectorBlurOperation.cpp')
-rw-r--r-- | source/blender/compositor/operations/COM_VectorBlurOperation.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/compositor/operations/COM_VectorBlurOperation.cpp b/source/blender/compositor/operations/COM_VectorBlurOperation.cpp index ebf3b772b3b..08ef1249a6a 100644 --- a/source/blender/compositor/operations/COM_VectorBlurOperation.cpp +++ b/source/blender/compositor/operations/COM_VectorBlurOperation.cpp @@ -23,6 +23,8 @@ #include "COM_VectorBlurOperation.h" #include "BLI_math.h" +#include "MEM_guardedalloc.h" + // use the implementation of blender internal renderer to calculate the vector blur. extern "C" { #include "RE_pipeline.h" @@ -66,7 +68,7 @@ void VectorBlurOperation::deinitExecution() this->m_inputSpeedProgram = NULL; this->m_inputZProgram = NULL; if (this->m_cachedInstance) { - delete [] this->m_cachedInstance; + MEM_freeN(this->m_cachedInstance); this->m_cachedInstance = NULL; } } @@ -81,8 +83,7 @@ void *VectorBlurOperation::initializeTileData(rcti *rect) MemoryBuffer *tile = (MemoryBuffer *)this->m_inputImageProgram->initializeTileData(rect); MemoryBuffer *speed = (MemoryBuffer *)this->m_inputSpeedProgram->initializeTileData(rect); MemoryBuffer *z = (MemoryBuffer *)this->m_inputZProgram->initializeTileData(rect); - float *data = new float[this->getWidth() * this->getHeight() * COM_NUMBER_OF_CHANNELS]; - memcpy(data, tile->getBuffer(), this->getWidth() * this->getHeight() * COM_NUMBER_OF_CHANNELS * sizeof(float)); + float *data = (float *)MEM_dupallocN(tile->getBuffer()); this->generateVectorBlur(data, tile, speed, z); this->m_cachedInstance = data; } @@ -115,6 +116,6 @@ void VectorBlurOperation::generateVectorBlur(float *data, MemoryBuffer *inputIma blurdata.curved = this->m_settings->curved; blurdata.fac = this->m_settings->fac; RE_zbuf_accumulate_vecblur(&blurdata, this->getWidth(), this->getHeight(), data, inputImage->getBuffer(), inputSpeed->getBuffer(), zbuf); - delete [] zbuf; + MEM_freeN((void *)zbuf); return; } |