mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-17 02:43:14 +00:00
Fix compile errors in Debug - MemLeak.
Add rpcs3/define_new_memleakdetect.h to save and replace new operator with Visual Studio Memory Leak Detection's operator. Add rpcs3/restore_new.h to restore new operator to a previous saved state.
This commit is contained in:
parent
ec9740e747
commit
1e60319be2
@ -1,5 +1,7 @@
|
||||
#include "stdafx.h"
|
||||
#include "restore_new.h"
|
||||
#include <wx/msgdlg.h>
|
||||
#include "define_new_memleakdetect.h"
|
||||
#include "rMsgBox.h"
|
||||
|
||||
#ifndef QT_UI
|
||||
|
@ -1,5 +1,7 @@
|
||||
#include "stdafx.h"
|
||||
#include "restore_new.h"
|
||||
#include <wx/image.h>
|
||||
#include "define_new_memleakdetect.h"
|
||||
|
||||
#ifndef _WIN32
|
||||
#include <dirent.h>
|
||||
|
@ -4,7 +4,9 @@
|
||||
#include "sha1.h"
|
||||
#include "key_vault.h"
|
||||
#include "unpkg.h"
|
||||
#include "restore_new.h"
|
||||
#include <wx/progdlg.h>
|
||||
#include "define_new_memleakdetect.h"
|
||||
|
||||
#include "Utilities/Log.h"
|
||||
#include "Utilities/rFile.h"
|
||||
|
6
rpcs3/define_new_memleakdetect.h
Normal file
6
rpcs3/define_new_memleakdetect.h
Normal file
@ -0,0 +1,6 @@
|
||||
//Override the new operator to use the memory leak detection from visual studio
|
||||
//Does not work with placement new
|
||||
#if defined(MSVC_CRT_MEMLEAK_DETECTION) && defined(_DEBUG) && defined(DBG_NEW)
|
||||
#pragma push_macro("new")
|
||||
#define new DBG_NEW
|
||||
#endif
|
@ -250,6 +250,7 @@
|
||||
<ClInclude Include="Crypto\unpkg.h" />
|
||||
<ClInclude Include="Crypto\unself.h" />
|
||||
<ClInclude Include="Crypto\utils.h" />
|
||||
<ClInclude Include="define_new_memleakdetect.h" />
|
||||
<ClInclude Include="Emu\ARMv7\ARMv7Decoder.h" />
|
||||
<ClInclude Include="Emu\ARMv7\ARMv7DisAsm.h" />
|
||||
<ClInclude Include="Emu\ARMv7\ARMv7Interpreter.h" />
|
||||
@ -416,6 +417,7 @@
|
||||
<ClInclude Include="Loader\SELF.h" />
|
||||
<ClInclude Include="Loader\TROPUSR.h" />
|
||||
<ClInclude Include="Loader\TRP.h" />
|
||||
<ClInclude Include="restore_new.h" />
|
||||
<ClInclude Include="stdafx.h" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
|
@ -1204,5 +1204,11 @@
|
||||
<ClInclude Include="Emu\SysCalls\Modules\cellSaveData.h">
|
||||
<Filter>Emu\SysCalls\Modules</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="restore_new.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="define_new_memleakdetect.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
5
rpcs3/restore_new.h
Normal file
5
rpcs3/restore_new.h
Normal file
@ -0,0 +1,5 @@
|
||||
//Restore the new operator if previously saved before overriding
|
||||
//Allow the use of placement new
|
||||
#if defined(MSVC_CRT_MEMLEAK_DETECTION) && defined(_DEBUG) && defined(DBG_NEW)
|
||||
#pragma pop_macro("new")
|
||||
#endif
|
@ -10,7 +10,7 @@
|
||||
|
||||
#if defined(MSVC_CRT_MEMLEAK_DETECTION) && defined(_DEBUG) && !defined(DBG_NEW)
|
||||
#define DBG_NEW new ( _NORMAL_BLOCK , __FILE__ , __LINE__ )
|
||||
#define new DBG_NEW
|
||||
#include "define_new_memleakdetect.h"
|
||||
#endif
|
||||
|
||||
// This header should be frontend-agnostic, so don't assume wx includes everything
|
||||
|
Loading…
x
Reference in New Issue
Block a user