Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Memory leak with CvCapture

Hello,

I was just testing a camera capture example and realized I was having memory leak problems. Trying to find out where the problem was, i just keep cutting the code until got this piece of code in c++:

int main(){ while(1){ CvCapture* input=cvCreateCameraCapture(1); cvReleaseCapture(&input); } return 0; }

Well, as you can see I am just allocating and releasing "input". Testing this on OpenCv 2.4.8 and 2.3.1 has the same effect. The code keep allocating memory over the time. In some sense, this code shoudn't increase the memory allocation over the time. Is this really a memory leaking or am I missing something?

ps: I am using visual c++ 2010 and codeblocks in windows 7.

Memory leak with CvCapture

Hello,

I was just testing a camera capture example and realized I was having memory leak problems. Trying to find out where the problem was, i just keep cutting the code until got this piece of code in c++:

int main(){ main(){

while(1){
     CvCapture* input=cvCreateCameraCapture(1);
     cvReleaseCapture(&input);
 }
 return 0;

}

Well, as you can see I am just allocating and releasing "input". Testing this on OpenCv 2.4.8 and 2.3.1 has the same effect. The code keep allocating memory over the time. In some sense, this code shoudn't increase the memory allocation over the time. Is this really a memory leaking or am I missing something?

ps: I am using visual c++ 2010 and codeblocks in windows 7.