B
Bill Rogers
I have been trying to get _CrtDumpMemoryLeaks() to report the allocation
point file and line number in my source file. Instead it always reports the
allocation occurred in crtdbg.h, line 692. I would like it to report my
source file name and line number. What am I missing?
Thanks,
Bill Rogers
Test program code:
// LeakTest.cpp : Defines the entry point for the console application.
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>
#include <tchar.h>
int _tmain(int argc, _TCHAR* argv[])
{
char *s = new char[100];
_CrtDumpMemoryLeaks();
return 0;
}
This produces the following output in the output window:
Detected memory leaks!
Dumping objects ->
c:\program files\microsoft visual studio .net 2003\vc7\include\crtdbg.h(692)
: {43} normal block at 0x00320FF0, 100 bytes long.
Data: < > CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD
Object dump complete.
The program '[1932] LeakTest.exe: Native' has exited with code 0 (0x0).
point file and line number in my source file. Instead it always reports the
allocation occurred in crtdbg.h, line 692. I would like it to report my
source file name and line number. What am I missing?
Thanks,
Bill Rogers
Test program code:
// LeakTest.cpp : Defines the entry point for the console application.
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>
#include <tchar.h>
int _tmain(int argc, _TCHAR* argv[])
{
char *s = new char[100];
_CrtDumpMemoryLeaks();
return 0;
}
This produces the following output in the output window:
Detected memory leaks!
Dumping objects ->
c:\program files\microsoft visual studio .net 2003\vc7\include\crtdbg.h(692)
: {43} normal block at 0x00320FF0, 100 bytes long.
Data: < > CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD
Object dump complete.
The program '[1932] LeakTest.exe: Native' has exited with code 0 (0x0).