From b62c0cf100b4a7497452e54bcb9a9d6acbde92de Mon Sep 17 00:00:00 2001 From: Daniel Chappuis Date: Wed, 10 Oct 2018 20:24:51 +0200 Subject: [PATCH] Fix issue in PoolAllocator: Use default base allocator instead of free() --- src/memory/PoolAllocator.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/memory/PoolAllocator.cpp b/src/memory/PoolAllocator.cpp index f73ab150..7e9c0a93 100644 --- a/src/memory/PoolAllocator.cpp +++ b/src/memory/PoolAllocator.cpp @@ -135,9 +135,9 @@ void* PoolAllocator::allocate(size_t size) { MemoryBlock* currentMemoryBlocks = mMemoryBlocks; mNbAllocatedMemoryBlocks += 64; mMemoryBlocks = static_cast(MemoryManager::getBaseAllocator().allocate(mNbAllocatedMemoryBlocks * sizeof(MemoryBlock))); - memcpy(mMemoryBlocks, currentMemoryBlocks,mNbCurrentMemoryBlocks * sizeof(MemoryBlock)); + memcpy(mMemoryBlocks, currentMemoryBlocks, mNbCurrentMemoryBlocks * sizeof(MemoryBlock)); memset(mMemoryBlocks + mNbCurrentMemoryBlocks, 0, 64 * sizeof(MemoryBlock)); - free(currentMemoryBlocks); + MemoryManager::getBaseAllocator().release(currentMemoryBlocks, mNbCurrentMemoryBlocks * sizeof(MemoryBlock)); } // Allocate a new memory blocks for the corresponding heap and divide it in many