3d - Detecting Memory leak in Metro application using CRT library -
i developing 3d game windows store. have detected memory leaks in game not able see file name , line number of memory leaks in output while debugging. following lines of code have included detect memory leaks:
#define _crtdbg_map_alloc #include <stdlib.h> #include <crtdbg.h> _crtdumpmemoryleaks();
the following output on debugging application:
detected memory leaks! dumping objects -> {1686} normal block @ 0x06fd72e8, 8 bytes long. data: < > 08 f5 fe 03 00 00 00 00 {1685} normal block @ 0x03fef500, 40 bytes long. data: < x r > 20 e5 b4 01 78 ee fe 03 e8 72 fd 06 00 a9 03 04 {1684} normal block @ 0x0403a900, 64 bytes long. data: <w n d o w s . > 57 00 69 00 6e 00 64 00 6f 00 77 00 73 00 2e 00 {1676} normal block @ 0x0406c858, 36 bytes long. data: < k > ff ff 00 00 ff ee 82 ee ff 4b 00 82 ff 00 00 ff {1658} normal block @ 0x06fd7208, 8 bytes long. data: < > 80 ee fe 03 00 00 00 00 {1657} normal block @ 0x03feee78, 40 bytes long. data: < r j > 00 f5 fe 03 f8 f3 fe 03 08 72 fd 06 e0 4a f7 06
whereas, according microsoft blogs, should getting name of file , line number when _crtdbg_map_alloc included in code following:
detected memory leaks! dumping objects -> c:\program files\visual studio\myprojects\leaktest\leaktest.cpp(20) : {18} normal block @ 0x00780e80, 64 bytes long. data: < > cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd object dump complete.
i not getting similar output (file name , line number) after including _crtdbg_map_alloc in code. please me resolve issue.
thanks in advance!
there similar questions on so
does work?
#ifdef _debug #define debug_new_placement (_normal_block, __file__, __line__) #else #define debug_new_placement #endif int* p = new debug_new_placement int(5);
alternatively, if memory allocation number (inside curly braces) same, can set break point using number, e.g.
_crtsetbreakalloc(18);
details here
Comments
Post a Comment