diff --git a/amxmodx/sdk/amxxmodule.cpp b/amxmodx/sdk/amxxmodule.cpp index 72717133..88a48c5a 100755 --- a/amxmodx/sdk/amxxmodule.cpp +++ b/amxmodx/sdk/amxxmodule.cpp @@ -2688,8 +2688,6 @@ void ValidateMacros_DontCallThis_Smiley() } #endif -#ifdef MEMORY_TEST - /************* MEMORY *************/ // undef all defined macros #undef new @@ -2803,7 +2801,7 @@ void *operator new(size_t reportedSize) return ptr; // allocation failed - throw std::bad_alloc(); + return NULL; } void *operator new[](size_t reportedSize) @@ -2816,7 +2814,7 @@ void *operator new[](size_t reportedSize) return ptr; // allocation failed - throw std::bad_alloc(); + return NULL; } // Microsoft memory tracking operators @@ -2830,7 +2828,7 @@ void *operator new(size_t reportedSize, const char *sourceFile, int sourceLine) return ptr; // allocation failed - throw std::bad_alloc(); + return NULL; } void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine) { @@ -2842,7 +2840,7 @@ void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine return ptr; // allocation failed - throw std::bad_alloc(); + return NULL; } void operator delete(void *reportedAddress) @@ -2861,8 +2859,6 @@ void operator delete[](void *reportedAddress) Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete_array, reportedAddress); } -#endif //MEMORY_TEST - /************* stuff from dlls/util.cpp *************/ // must come here because cbase.h declares it's own operator new diff --git a/amxmodx/sdk/amxxmodule.h b/amxmodx/sdk/amxxmodule.h index 626a6435..0d44ad13 100755 --- a/amxmodx/sdk/amxxmodule.h +++ b/amxmodx/sdk/amxxmodule.h @@ -2135,8 +2135,6 @@ void MF_Log(const char *fmt, ...); #define MF_GetPlayerEdict g_fn_GetPlayerEdict #define MF_Format g_fn_Format; -#ifdef MEMORY_TEST - /*** Memory ***/ void *operator new(size_t reportedSize); void *operator new[](size_t reportedSize); @@ -2180,6 +2178,4 @@ void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, cons #define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr) #define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr) -#endif //MEMORY_TEST - #endif // #ifndef __AMXXMODULE_H__ diff --git a/amxmodx/sdk/moduleconfig.h b/amxmodx/sdk/moduleconfig.h index 251ca6bd..bd742e06 100755 --- a/amxmodx/sdk/moduleconfig.h +++ b/amxmodx/sdk/moduleconfig.h @@ -18,9 +18,6 @@ #define MODULE_DATE "Unknown" #endif // __DATE__ -// looking for mem leaks? -// #define MEMORY_TEST - // metamod plugin? // #define USE_METAMOD