3、如何解决获得具体泄露的位置:
#ifdef _DEBUG
#define new new(_NORMAL_BLOCK,__FILE__, __LINE__)
#endif 运行结果如下: Detected memory leaks!
Dumping objects ->
f:/testvc/factory/factory.cpp(93) : {54} normal block at 0x00371078, 4 bytes long.
Data: < D > 94 20 44 00
f:/testvc/factory/factory.cpp(102) : {53} normal block at 0x00371038, 4 bytes long.
Data: < D > BC 20 44 00
Object dump complete.
|