Fix imbuf users leak in MovieClip tiles node

Leak was caused by not calling IMB_freeImBuf for result of BKE_movieclip_get_ibuf
This commit is contained in:
Sergey Sharybin 2012-05-22 09:15:05 +00:00
parent 1ae3929138
commit d3067dfaa2
2 changed files with 14 additions and 3 deletions

@ -30,6 +30,7 @@ extern "C" {
#include "DNA_movieclip_types.h"
#include "BKE_movieclip.h"
#include "BKE_tracking.h"
#include "IMB_imbuf.h"
}
MovieClipNode::MovieClipNode(bNode *editorNode): Node(editorNode)
@ -118,4 +119,8 @@ void MovieClipNode::convertToOperations(ExecutionSystem *graph, CompositorContex
angleMovieClip->relinkConnections(operationSetValue->getOutputSocket());
graph->addOperation(operationSetValue);
}
if (ibuf) {
IMB_freeImBuf(ibuf);
}
}

@ -61,8 +61,12 @@ void MovieClipOperation::initExecution()
void MovieClipOperation::deinitExecution()
{
if (this->movieClipBuffer) {
IMB_freeImBuf(this->movieClipBuffer);
this->movieClipBuffer = NULL;
}
}
void MovieClipOperation::determineResolution(unsigned int resolution[], unsigned int preferredResolution[])
{
@ -76,6 +80,8 @@ void MovieClipOperation::determineResolution(unsigned int resolution[], unsigned
if (ibuf) {
resolution[0] = ibuf->x;
resolution[1] = ibuf->y;
IMB_freeImBuf(ibuf);
}
}
}