Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-08-16 16:32:48 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-08-16 16:32:48 +0400
commit3bc16fd60dd573f8289552a0046b0735d1c7e02b (patch)
tree3936a357fd922e96b622f29f04804b20cb11f234 /source/blender/compositor/operations/COM_InpaintOperation.cpp
parent883e9df1ccdaaa847c86e2d1457fd88333b87c84 (diff)
compositor: replace C++ new/delete with guardedalloc.
Diffstat (limited to 'source/blender/compositor/operations/COM_InpaintOperation.cpp')
-rw-r--r--source/blender/compositor/operations/COM_InpaintOperation.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/source/blender/compositor/operations/COM_InpaintOperation.cpp b/source/blender/compositor/operations/COM_InpaintOperation.cpp
index 9ce682ffe49..bfc0ecd1c00 100644
--- a/source/blender/compositor/operations/COM_InpaintOperation.cpp
+++ b/source/blender/compositor/operations/COM_InpaintOperation.cpp
@@ -121,7 +121,7 @@ void InpaintSimpleOperation::calc_manhatten_distance()
{
int width = this->getWidth();
int height = this->getHeight();
- short *m = this->m_manhatten_distance = new short[width * height];
+ short *m = this->m_manhatten_distance = (short *)MEM_mallocN(sizeof(short) * width * height, __func__);
int *offsets;
offsets = (int *)MEM_callocN(sizeof(int) * (width + height + 1), "InpaintSimpleOperation offsets");
@@ -163,7 +163,7 @@ void InpaintSimpleOperation::calc_manhatten_distance()
}
this->m_area_size = offsets[width + height];
- this->m_pixelorder = new int[this->m_area_size];
+ this->m_pixelorder = (int *)MEM_mallocN(sizeof(int) * this->m_area_size, __func__);
for (int i = 0; i < width * height; i++) {
if (m[i] > 0) {
@@ -224,9 +224,7 @@ void *InpaintSimpleOperation::initializeTileData(rcti *rect)
lockMutex();
if (!this->m_cached_buffer_ready) {
MemoryBuffer *buf = (MemoryBuffer *)this->m_inputImageProgram->initializeTileData(rect);
-
- this->m_cached_buffer = new float[this->getWidth() * this->getHeight() * COM_NUMBER_OF_CHANNELS];
- memcpy(this->m_cached_buffer, buf->getBuffer(), this->getWidth() * this->getHeight() * COM_NUMBER_OF_CHANNELS * sizeof(float));
+ this->m_cached_buffer = (float *)MEM_dupallocN(buf->getBuffer());
this->calc_manhatten_distance();
@@ -255,17 +253,17 @@ void InpaintSimpleOperation::deinitExecution()
this->m_inputImageProgram = NULL;
this->deinitMutex();
if (this->m_cached_buffer) {
- delete [] this->m_cached_buffer;
+ MEM_freeN(this->m_cached_buffer);
this->m_cached_buffer = NULL;
}
if (this->m_pixelorder) {
- delete [] this->m_pixelorder;
+ MEM_freeN(this->m_pixelorder);
this->m_pixelorder = NULL;
}
if (this->m_manhatten_distance) {
- delete [] this->m_manhatten_distance;
+ MEM_freeN(this->m_manhatten_distance);
this->m_manhatten_distance = NULL;
}
this->m_cached_buffer_ready = false;