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_MovieDistortionOperation.h | |
parent | 883e9df1ccdaaa847c86e2d1457fd88333b87c84 (diff) |
compositor: replace C++ new/delete with guardedalloc.
Diffstat (limited to 'source/blender/compositor/operations/COM_MovieDistortionOperation.h')
-rw-r--r-- | source/blender/compositor/operations/COM_MovieDistortionOperation.h | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/source/blender/compositor/operations/COM_MovieDistortionOperation.h b/source/blender/compositor/operations/COM_MovieDistortionOperation.h index 00723d92a84..7e62de7b9f1 100644 --- a/source/blender/compositor/operations/COM_MovieDistortionOperation.h +++ b/source/blender/compositor/operations/COM_MovieDistortionOperation.h @@ -25,6 +25,8 @@ #include "COM_NodeOperation.h" #include "DNA_movieclip_types.h" +#include "MEM_guardedalloc.h" + extern "C" { #include "BKE_tracking.h" #include "PIL_time.h" @@ -62,22 +64,19 @@ public: this->m_calibration_width = calibration_width; this->m_calibration_height = calibration_height; this->m_inverted = inverted; - this->m_bufferCalculated = new int[this->m_width * this->m_height]; - this->m_buffer = new float[this->m_width * this->m_height * 2]; - for (int i = 0; i < this->m_width * this->m_height; i++) { - this->m_bufferCalculated[i] = 0; - } + this->m_bufferCalculated = (int *)MEM_callocN(sizeof(int) * this->m_width * this->m_height, __func__); + this->m_buffer = (float *)MEM_mallocN(sizeof(float) * this->m_width * this->m_height * 2, __func__); this->updateLastUsage(); } ~DistortionCache() { if (this->m_buffer) { - delete[] this->m_buffer; + MEM_freeN(this->m_buffer); this->m_buffer = NULL; } if (this->m_bufferCalculated) { - delete[] this->m_bufferCalculated; + MEM_freeN(this->m_bufferCalculated); this->m_bufferCalculated = NULL; } } |