Ask Your Question

Gigatonn's profile - activity

2014-02-19 13:47:59 -0600 commented question Memory leak with CvCapture

Thank you for your time. I just executed this piece of code and let it run a while. The memory just keep growing at slow pace. The example I tested before seeing the leak problem was like the example you posted. In this case, I believe that cvReleaseCapture do not free the memory like I wanted to.

2014-02-18 19:44:35 -0600 received badge  Editor (source)
2014-02-18 19:43:45 -0600 asked a question 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.