文件名称:VC内存泄露误报演示程序
文件大小:83KB
文件格式:7Z
更新时间:2016-11-19 11:47:02
VC 内存泄露 误报
使用vc开发mfc程序时,在调用了win32 dll(即不使用mfc的dll)时,mfc90.dll后于win32dll加载,在退出程序时mfc90.dll先释放,这时它会将win32dll中的全局变量,函数static变量视为内存泄露,而实际上随后win32dll卸载时会正常释放,导致内存泄露误报。 本程序演示了win32dll中的std::string的全局变量和函数内static变量的内存泄露误报 用法:编译好后,起动程序点击下button,然后退出程序,观察output窗口的输出
【文件预览】:
win32dll
----win32dll.cpp(458B)
----Debug()
--------BuildLog.htm(7KB)
----win32dll.suo(11KB)
----win32dll.sln(881B)
----win32dll.h(48B)
----stdafx.h(459B)
----ReadMe.txt(2KB)
----stdafx.cpp(295B)
----win32dll.vcproj(5KB)
----dllmain.cpp(410B)
----targetver.h(1KB)
theMFCleakTest
----resource.h(686B)
----theMFCleakTestDlg.h(697B)
----Debug()
--------BuildLog.htm(21KB)
----theMFCleakTestDlg.cpp(4KB)
----theMFCleakTest.rc(6KB)
----theMFCleakTest.aps(103KB)
----stdafx.h(2KB)
----theMFCleakTest.h(556B)
----ReadMe.txt(4KB)
----theMFCleakTest.vcproj(6KB)
----res()
--------theMFCleakTest.ico(66KB)
--------theMFCleakTest.rc2(405B)
----theMFCleakTest.suo(112KB)
----stdafx.cpp(216B)
----theMFCleakTest.sln(1KB)
----theMFCleakTest.cpp(2KB)
----targetver.h(1KB)