内存泄露检测

来源:互联网 发布:兄弟连 php 课程表 编辑:程序博客网 时间:2024/06/05 02:07
#define CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>


无论程序在什么地方退出都会自动调用 _CrtDumpMemoryLeaks


_CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );


.............


_CrtDumpMemoryLeaks();
0 0