Memory Leak with CCTexture2D on iOS (cocos2d-x)

Hello!

I am new to Cocos2D and I am currently playing with Cocos2Dx on the iOS SDK.

Based on the HelloWorld App I have made some additions by loading a captured image (using the Cinder lib) and transforming it into a CCTexture2D for a sprite. But it seems that the Texture setup method is causing a memory leak, so that the app is crashing after some time. The following code shows the update method, which is called by

“this~~>schedule, 1);”
<pre>
void HelloWorld::update
{
//Capture a cam image
surf1 = capture.getSurface.clone;
uint8_t thr = round;
//ip::threshold;
//Perform edge detection
ip::edgeDetectSobel,&surf2.getChannelAlpha);
//Perform a threshold
ip::threshold;
//get data dimensions
CCSize ssize, surf1.getHeight);
//THIS LINE IS CAUSING THE MEMORY LEAK
texture1.initWithData, kCCTexture2DPixelFormat_RGBA8888, surf1.getWidth, surf1.getHeight, ssize);
sprite1~~>setTexture(&texture1);
}

Can anybody help me?

Hi, What is surf1? are you releasing it?