Created
July 3, 2014 02:00
-
-
Save zsh-89/14dba930c76c97c79363 to your computer and use it in GitHub Desktop.
The one with expected behavior.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define _CRTDBG_MAP_ALLOC | |
#include <crtdbg.h> | |
#include <opencv2/opencv.hpp> | |
#include "opencv2/core/core.hpp" | |
#include "opencv2/imgproc/imgproc.hpp" | |
#include "opencv2/calib3d/calib3d.hpp" | |
#include "opencv2/highgui/highgui.hpp" | |
int main(void) | |
{ | |
_CrtSetDbgFlag(_CrtSetDbgFlag(_CRTDBG_REPORT_FLAG) | _CRTDBG_LEAK_CHECK_DF); | |
{ | |
cv::Mat xx = cv::imread("B:/cc.png"); | |
cv::imshow("win title", xx); | |
} | |
//int *p = new int; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No output because there's no memory leak.
But _CrtSetDbgFlag() have actually enabled the memory leak detection.
_CrtDumpMemoryLeaks() is called automatically and implicitly at the termination of this program because we have used _CrtSetDbgFlag properly.
Try uncomment
//int *p = new int;