ppsspp/Common/DbgNew.h
Henrik Rydgard 35b6c7341b Fix a bunch of memory leaks, after enabling file+line-number memory leak tracking for the MS Debug CRT.
Few of these were serious, most were on-exit, but good to have a cleaner memory report after running.
2016-02-10 15:36:10 +01:00

16 lines
337 B
C

#pragma once
// Utility file for using the MS CRT's memory tracking.
// crtdbg.h overloads malloc with malloc_dbg etc, but does not catch new. So here we go.
#include <crtdbg.h>
#ifdef _DEBUG
#define USE_CRT_DBG
#ifndef DBG_NEW
#define DBG_NEW new ( _NORMAL_BLOCK , __FILE__ , __LINE__ )
#define new DBG_NEW
#endif
#endif // _DEBUG