rt: memory_region::free(NULL) shouldn't touch the live allocation count

This commit is contained in:
Patrick Walton 2011-06-16 11:13:23 -07:00
parent 4673eb6839
commit 02c0501a61
1 changed files with 1 additions and 0 deletions

View File

@ -21,6 +21,7 @@ memory_region::memory_region(memory_region *parent) :
void memory_region::free(void *mem) {
// printf("free: ptr 0x%" PRIxPTR"\n", (uintptr_t) mem);
if (!mem) { return; }
if (_synchronized) { _lock.lock(); }
#ifdef TRACK_ALLOCATIONS
if (_allocation_list.replace(mem, NULL) == false) {