Rational Purify找不到内存泄露
用vc2003建了一个终端程序
int main()
{
char *p = new char[16];
return 0;
}
用Purify运行后并没有提示有内存泄露,这是为什么?
[解决办法]
[I] Starting Purify 'd C:\temp\purify\Debug\purify.exe at 2007-05-11 09:20:45
[I] Starting main
[I] Summary of all memory leaks... {16 bytes, 1 block}
[W] MLK: Memory leak of 16 bytes from 1 block allocated in main [purify.exe]
Distribution of leaked blocks
Allocation location
new(UINT) [new.cpp:23]
main [c:\temp\purify\purify.cpp:3]
int main()
{
=> char *p = new char[16];
return 0;
}
mainCRTStartup [crt0.c:206]
[I] Exiting with code 0 (0x00000000)
[I] Program terminated at 2007-05-11 09:20:47
有啊。