给自己做个记号
1.先运行Windbg安装目录下的gflags.exe,Image File,Image填exe名字,不要全路径,选上Create user mode stack trace database;
2.在Windbg中调试模式运行程序,在退出时显示:
e:\vs工程\tests\testsdlg.cpp(101) : {125} normal block at 0x003B9578, 100 bytes long.
Data: < > CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD
3.执行!heap -x 命令
0:000> !heap -x 0x003B9578
Entry User Heap Segment Size PrevSize Unused Flags
-----------------------------------------------------------------------------
003b9550 003b9558 003b0000 003b0640 a0 808 18 busy extra fill
4.执行!heap -p -a 003b9550