´ÙÀ½°ú °°Àº ÆÄÀÏÀ» ¸¸µé°í, À̸¦ LeakWatcher.h¶ó´Â À̸§À¸·Î ÀúÀåÇß´Ù°í ÇÏÀÚ.
#ifndef IMWATCHINGYOULEAK
#define IMWATCHINGYOULEAK
#include <crtdbg.h>
#ifdef _DEBUG
#define THIS_FILE __FILE__
inline void* __cdecl operator new(size_t size, const char* filename, int line)
{
return ::operator new(size, 1, filename, line);
}
inline void __cdecl operator delete(void* ptr, const char *filename, int line)
{
::operator delete(ptr, _NORMAL_BLOCK, filename, line);
}
#define DEBUG_NEW new(THIS_FILE, __LINE__)
#define malloc(s) _malloc_dbg(s, _NORMAL_BLOCK, THIS_FILE, __LINE__)
#define calloc(c, s) _calloc_dbg(c, s, _NORMAL_BLOCK, THIS_FILE, __LINE__)
#define realloc(p, s) _realloc_dbg(p, s, _NORMAL_BLOCK, THIS_FILE, __LINE__)
#define _expand(p, s) _expand_dbg(p, s, _NORMAL_BLOCK, THIS_FILE, __LINE__)
#define free(p) _free_dbg(p, _NORMAL_BLOCK)
#define _msize(p) _msize_dbg(p, _NORMAL_BLOCK)
#endif // _DEBUG
#endif // IMWATCHINGYOULEAK