您的位置:首页 > 其它

vc中查memory leak

2011-05-20 23:53 92 查看
// to check memory leak
#define  _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>

//...

// will print LEAKS information to Output window
_CrtDumpMemoryLeaks();

// or
// if app has multi-exit point, can use following function at the beginning of program to set the check on, it will excute when the app eixt
_CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: