new 内存泄漏-调试代码

Dumping objects ->
{1318} normal block at 0x0000014B5EE13440, 8 bytes long.
 Data:

70 00 00 00 00 00 00 00 
{1317} normal block at 0x0000014B5ED26750, 40 bytes long.
 Data: <(Ac     @4 ^K   > 28 41 63 A5 F6 7F 00 00 40 34 E1 5E 4B 01 00 00 
{1316} normal block at 0x0000014B5EE11A50, 8 bytes long.
 Data: 6E 00 00 00 00 00 00 00 
{1315} normal block at 0x0000014B5ED27400, 40 bytes long.
 Data: <(Ac     P  ^K   > 28 41 63 A5 F6 7F 00 00 50 1A E1 5E 4B 01 00 00 
Object dump complete.

 

 

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

将该代码加入到包含new 操作的cpp文件头,vs 最终output的时候就能够打印出问题出现的位置。

你可能感兴趣的:(错误)