检测内存泄漏

 #define _CRTDBG_MAP_ALLOC
 #include <stdlib.h>
 #include <windows.h>
 int main(int argc , char* args[])
 {
     // 这里运行程序,并在下面的函数调用之前delete掉所有new的东西
     _CrtDumpMemoryLeaks();
    return 0;
 }

vs中检测内存泄漏的方法。

原文地址:https://www.cnblogs.com/lwngreat/p/4476239.html