From 7ea47c5a96551912e9ad9e2608549a19676aef7d Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sun, 21 Aug 2005 21:54:14 +0000 Subject: [PATCH] Fixed a deallocation mismatch with debug plugins in linux --- amxmodx/modules.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/amxmodx/modules.cpp b/amxmodx/modules.cpp index 5b466993..40fb1d2b 100755 --- a/amxmodx/modules.cpp +++ b/amxmodx/modules.cpp @@ -603,7 +603,12 @@ int unload_amxscript(AMX* amx, void** program) #if defined JIT #if defined __linux__ && defined MEMORY_TEST #undef free - free(prg); + if (flags & AMX_FLAG_DEBUG) + { + delete [] prg; + } else { + free(prg); + } #define free(ptr) m_deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr) #elif defined WIN32 if (flags & AMX_FLAG_DEBUG)