mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-16 23:17:29 +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
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
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…
Reference in New Issue
Block a user