What sucks is that using Visual Studio's method, it picks up the memory leaks just fine, but doesn't tell me where in the world they originated from!
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>
int main () {
_CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
char *pChar = new char[30];
pChar = 0;
int *pInt = new int;
return 0;
}
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>
int main () {
_CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
char *pChar = new char[30];
pChar = 0;
int *pInt = new int;
return 0;
}
To copy to clipboard, switch view to plain text mode
Detected memory leaks!
Dumping objects ->
{61} normal block at 0x00335FD8, 4 bytes long.
Data: < > CD CD CD CD
{60} normal block at 0x00332A00, 30 bytes long.
Data: < > CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD
Object dump complete.
The program '[1380] exceptions.exe: Native' has exited with code 0 (0x0).
Anyone know what I'm doing wrong here?
Paul
Bookmarks