CVCapture memory leak (Bug #1749)
Description
Platform: windows7
Compiler: c++ vc2010
Sample code to repro issue:
1#include <cv.h>
2
3#include <highgui.h>
4
5#include <opencv2/features2d/features2d.hpp>
6#include <opencv2/highgui/highgui.hpp>
7#include <opencv2/imgproc/imgproc_c.h>
8
9#include <crtdbg.h>
10#include <cassert>
11
12using namespace cv;
13
14int main ( int argc, char **argv )
15{
16 _CrtMemState state;
17 int tmpDbgFlag;
18 tmpDbgFlag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
19 tmpDbgFlag |= _CRTDBG_LEAK_CHECK_DF;
20 _CrtSetDbgFlag(tmpDbgFlag);
21 _CrtSetReportMode( _CRT_ERROR, _CRTDBG_MODE_DEBUG );
22 _CrtMemCheckpoint(&state);
23
24 VideoCapture cap(0);
25 if(!cap.isOpened())
26 {
27 return -1;
28 }
29
30 _CrtMemDumpAllObjectsSince(&state);
31
32 return 0;
33}
Debug output:
.... Dumping objects -> {293} normal block at 0x0027D910, 24 bytes long. Data: < ' > CD CD CD CD CD CD CD CD CD CD CD CD 10 D9 27 00 {290} normal block at 0x04920040, 921600 bytes long. Data: < > CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD {289} normal block at 0x04830040, 921600 bytes long. Data: < > CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD {288} normal block at 0x04740040, 921600 bytes long. Data: < > 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 {285} normal block at 0x0027D1D0, 20 bytes long. Data: < 2 > AC 32 FD 00 00 00 00 00 FF FF FF FF FF FF FF FF Object dump complete. ...
Associated revisions
Merge pull request #1749 from SpecLad:update-ignore
History
Updated by Andrey Kamaev almost 13 years ago
- Description changed from Platform: windows7 Compiler: c++ vc2010 Sample code to repro issue: @ #inc... to Platform: windows7 Compiler: c++ vc2010 Sample code to repro issue: <pr... More
- Category set to highgui-images
Updated by Alexander Reshetnikov almost 13 years ago
This problem was detected and solved in r8274.
- Status changed from Open to Done
- Target version set to 2.4.1
- Assignee set to Alexander Reshetnikov
Updated by Andrey Kamaev almost 13 years ago
- Target version changed from 2.4.1 to 2.4.0
Updated by Andrey Kamaev over 12 years ago
- Category changed from highgui-images to highgui-camera