Hi, I'm trying to use the CRT memory leak detection but I keep getting the following message in Microsoft Visual Studio: "Detected memory leaks - skipping object dump." I can never get the it to actually do and object dump.
I followed the directions in the Microsoft article on Memory Leak Detection (http://msdn.microsoft.com/en-us/library/e5ewb1h3(VS.80).aspx) with no luck.
In my stdafx.h I have (rebuilt the entire project):
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>
In the entry point of my application I have:
_CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
I'm also hoping that it will display the file name and line number in the Microsoft advertised format:
Detected memory leaks!
Dumping objects ->
C:\PROGRAM FILES\VISUAL STUDIO\MyProjects\leaktest\leaktest.cpp(20) : {18}
normal block at 0x00780E80, 64 bytes long.
Data: < > CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD
Object dump complete.
While I've NEVER been able to even get an object dump, but I've noticed that other people say they see something along these lines (even with _CRTDBG_MAP_ALLOC defined):
Detected memory leaks!
Dumping objects ->
{18} normal block at 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 don't really want to spend time overriding the new and delete operators, so I was hoping that the CRT debugging would help me. If this doesn't work out I might end up overriding the new and delete operators, but I really want to get the allocation information with a file name and line number (crosses fingers).
Thanks, Kiril