From 4e636484c648878c95acc6167e6300c13f191327 Mon Sep 17 00:00:00 2001 From: skotlex Date: Thu, 8 Jun 2006 16:02:27 +0000 Subject: - Modified map_freeblock_unlock so that aFree errors will report the file/line that INVOKED the function rather than the function itself. NOTE: Do NOT disable the memory manager as that will break this change. This change is to be temporarily set until it can be resolved. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7049 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/map.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/map/map.c') diff --git a/src/map/map.c b/src/map/map.c index a26430776..28bdd5148 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -291,13 +291,15 @@ int map_freeblock_lock (void) * バッファにたまっていたblockを全部削除 *------------------------------------------ */ -int map_freeblock_unlock (void) +//Temporal debug function to figure out which unlock is causing already free'd pointer errors. +int map_freeblock_unlock_sub(const char * file, int line) { if ((--block_free_lock) == 0) { int i; for (i = 0; i < block_free_count; i++) { //Directly calling aFree shouldn't be a leak, as Free remembers the size the original pointed to memory was allocated with? [Skotlex] - aFree(block_free[i]); +// aFree(block_free[i]); + _mfree(block_free[i], file, line, __func__); block_free[i] = NULL; } block_free_count = 0; -- cgit v1.2.3-70-g09d2