mirror of https://github.com/snes9xgit/snes9x.git
win32: rework CHECK_MEMORY_LEAKS to dump after static object deinit
This commit is contained in:
parent
17b3a81419
commit
e014129b12
|
@ -0,0 +1,17 @@
|
||||||
|
// uncomment to find memory leaks at end
|
||||||
|
// #define CHECK_MEMORY_LEAKS
|
||||||
|
|
||||||
|
// to also display file locations in some cases define _CRTDBG_MAP_ALLOC in the project properties
|
||||||
|
|
||||||
|
#ifdef CHECK_MEMORY_LEAKS
|
||||||
|
// hack to make sure this object is destructed last
|
||||||
|
// msvc merges .CRT$XC in alphabetic order
|
||||||
|
// might not work in other versions of MSVC
|
||||||
|
#pragma init_seg(".CRT$XCB")
|
||||||
|
struct CallDumpMemLeaksLast {
|
||||||
|
~CallDumpMemLeaksLast() {
|
||||||
|
_CrtDumpMemoryLeaks();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
static CallDumpMemLeaksLast dump_last;
|
||||||
|
#endif
|
|
@ -534,6 +534,7 @@
|
||||||
<ClCompile Include="COpenGL.cpp" />
|
<ClCompile Include="COpenGL.cpp" />
|
||||||
<ClCompile Include="CXAudio2.cpp" />
|
<ClCompile Include="CXAudio2.cpp" />
|
||||||
<ClCompile Include="CXML.cpp" />
|
<ClCompile Include="CXML.cpp" />
|
||||||
|
<ClCompile Include="DumpAtEnd.cpp" />
|
||||||
<ClCompile Include="dxerr.cpp" />
|
<ClCompile Include="dxerr.cpp" />
|
||||||
<ClCompile Include="InputCustom.cpp" />
|
<ClCompile Include="InputCustom.cpp" />
|
||||||
<ClCompile Include="render.cpp" />
|
<ClCompile Include="render.cpp" />
|
||||||
|
|
|
@ -539,6 +539,9 @@
|
||||||
<ClCompile Include="..\msu1.cpp">
|
<ClCompile Include="..\msu1.cpp">
|
||||||
<Filter>APU</Filter>
|
<Filter>APU</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="DumpAtEnd.cpp">
|
||||||
|
<Filter>GUI</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="rsrc\nodrop.cur">
|
<None Include="rsrc\nodrop.cur">
|
||||||
|
|
|
@ -244,13 +244,6 @@
|
||||||
#include "wlanguage.h"
|
#include "wlanguage.h"
|
||||||
#include "../language.h"
|
#include "../language.h"
|
||||||
|
|
||||||
//uncomment to find memory leaks, with a line in WinMain
|
|
||||||
//#define CHECK_MEMORY_LEAKS
|
|
||||||
|
|
||||||
#ifdef CHECK_MEMORY_LEAKS
|
|
||||||
#include <crtdbg.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <commctrl.h>
|
#include <commctrl.h>
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
Loading…
Reference in New Issue