diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/main.cpp | 9 | ||||
-rw-r--r-- | common/scummsys.h | 8 |
2 files changed, 10 insertions, 7 deletions
diff --git a/common/main.cpp b/common/main.cpp index 22236f43d6..4091eca481 100644 --- a/common/main.cpp +++ b/common/main.cpp @@ -240,4 +240,13 @@ void *operator new(size_t size) { void operator delete(void *ptr) { free(ptr); } + +#undef free(x) +void free_check(void *ptr) { + if ((uint)ptr == 0xE7E7E7E7UL) { + printf("ERROR: freeing 0xE7E7E7E7\n"); + exit(1); + } + free(ptr); +} #endif diff --git a/common/scummsys.h b/common/scummsys.h index 224df158ff..95cdd0d57b 100644 --- a/common/scummsys.h +++ b/common/scummsys.h @@ -437,14 +437,8 @@ void operator delete(void *ptr); // Since 'new' now returns a memory block inited to 0xE7E7E7E7 we might // get some invocations of free() with that param. We check for those here. // That allows us to set a debugger breakpoint to catch it. -inline void free_check(void *ptr) { - if ((uint)ptr == 0xE7E7E7E7UL) { - printf("ERROR: freeing 0xE7E7E7E7\n"); - exit(1); - } - free(ptr); -} #define free(x) free_check(x) +void free_check(void *ptr); #endif #endif |