标签:
一、非MFC程序可以用以下方法检测内存泄露:
1.程序开始包含如下定义:
2.程序中添加下面的函数:
Debug版本程序运行结束后如有内存泄漏,输出窗口中会显示类似信息:
二、MFC程序内存泄漏检测方法:
1.在 CMyApp 中添加如下三个 CMemoryState 类的成员变量:
2.在 CMyApp::InitInstance() 中添加如下代码:
3.在 CMyApp::ExitInstance() 中添加如下代码:
Debug版本程序运行结束后如有内存泄漏,输出窗口中会显示类似信息:
本文转自:http://ufownl.blog.163.com/blog/static/1250122200861912757566/
http://blog.csdn.net/wangningyu/article/details/4465229
标签:
原文地址:http://www.cnblogs.com/findumars/p/5928697.html