2 #include "../Common/Common.h"
6 #include "MemoryLeak.h"
8 void EnableLeakDetection( void )
11 _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF
| _CRTDBG_LEAK_CHECK_DF
);
15 // Set the output to a file instead of the output window in Visual Studio
16 void SetOutputLeaksToFile()
22 hLogFile
= CreateFile(L
"memory_leak.log",
24 hLogFile
= CreateFile(TEXT("memory_leak.log"),
30 FILE_ATTRIBUTE_NORMAL
,
33 _CrtSetReportMode(_CRT_WARN
, _CRTDBG_MODE_FILE
);
34 _CrtSetReportFile(_CRT_WARN
, hLogFile
);
35 _RPT0(_CRT_WARN
,"file message\n");