I’m getting a memory leak in this code and I’m not able to find what I’m doing wrong.
CvCapture* capture = cvCaptureFromFile([[url path] UTF8String]);
while (cvGrabFrame(capture)) {
IplImage *frame = cvRetrieveFrame(capture);
if (frame) {
[...]
} else {
break;
}
}
cvReleaseCapture(&capture);
If I remove cvRetrieveFrame the memory leak disappears. If I change cvGrabFrame and cvRetrieveFrame with one cvQueryFrame the same behavior happens.
The behavior is the same with cvReleaseCapture enabled or commented out. So it’s probably something related to that, but I can’t figure out what.
I’m using openCV r7286 on iOS.
It was a bug in openCV. A fix is available in the latest trunk.