请问这种问题怎么办?
The thread 0x144 has exited with code 0 (0x0).
Detected memory leaks!
Dumping objects ->
{197} normal block at 0x004421F0, 49 bytes long.
Data: < > 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
Object dump complete.
这种leaks,一般倒不是会影响程序,但是有时候就会出错,
请问我该怎么查呢?
[解决办法]
检查memory leak不是件容易活,能想到的就是下面两个办法:
(1) 从debug信息分析. 在你的程序中泄漏内存中的值都是 "01 ", 想想可能是哪个变量的内容,再debug跟一遍看看这个变量的地址是不是0x004421f0
如果此方法不行,那之好来个彻底的方法了:
(2) 自定义malloc(), free(), operator new() ,operator delete(), operator new[]() 和 operator delete[]()函数, 记录申请内存情况. 程序退出前再检查是否都已释放.