tagging release
[dasher.git] / trunk / Src / DasherCore / MemoryLeak.h
blob7bca4f23c0afd41a9e85e6532e79f2ec5df1634b
2 #ifdef _WIN32
4 // Include the following code at the top of a cpp file to enable
5 // line level memory leak detection on Windows:
6 //
7 // // Track memory leaks on Windows to the line that new'd the memory
8 // #ifdef _WIN32
9 // #ifdef _DEBUG
10 // #define DEBUG_NEW new( _NORMAL_BLOCK, THIS_FILE, __LINE__ )
11 // #define new DEBUG_NEW
12 // #undef THIS_FILE
13 // static char THIS_FILE[] = __FILE__;
14 // #endif
15 // #endif
17 #pragma once
19 #include <windows.h>
21 #ifdef _DEBUG
22 #define _CRTDBG_MAP_ALLOC
23 #include <crtdbg.h>
24 #define DEBUG_NEW new( _NORMAL_BLOCK, THIS_FILE, __LINE__ )
25 #endif
27 void EnableLeakDetection(void);
28 void SetOutputLeaksToFile();
30 #endif