aboutsummaryrefslogtreecommitdiff
path: root/common/memorypool.cpp
diff options
context:
space:
mode:
authorJohannes Schickel2013-12-17 00:26:32 +0100
committerJohannes Schickel2013-12-17 00:26:50 +0100
commit3a8c243d340632c229380ac3d54c5e5e7ffa25c9 (patch)
tree2e2b709b9352c7fd20adca32b4f58a59d72b14cc /common/memorypool.cpp
parentb585addc23de25c019f250986d50c0373219571d (diff)
downloadscummvm-rg350-3a8c243d340632c229380ac3d54c5e5e7ffa25c9.tar.gz
scummvm-rg350-3a8c243d340632c229380ac3d54c5e5e7ffa25c9.tar.bz2
scummvm-rg350-3a8c243d340632c229380ac3d54c5e5e7ffa25c9.zip
COMMON: Revert "Fix mismatched new/delete in the MemoryPool class".
This reverts commit b585addc23de25c019f250986d50c0373219571d. The allocation of MemoryPool's page memory is doing in MemoryPool::allocPage, which uses ::malloc, thus we need to use ::free to free the page memory in MemoryPool::freeUnusedPages.
Diffstat (limited to 'common/memorypool.cpp')
-rw-r--r--common/memorypool.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/common/memorypool.cpp b/common/memorypool.cpp
index 3a31fd55ea..e3742eeae0 100644
--- a/common/memorypool.cpp
+++ b/common/memorypool.cpp
@@ -56,7 +56,7 @@ MemoryPool::~MemoryPool() {
#endif
for (size_t i = 0; i < _pages.size(); ++i)
- delete _pages[i].start;
+ ::free(_pages[i].start);
}
void MemoryPool::allocPage() {
@@ -152,7 +152,7 @@ void MemoryPool::freeUnusedPages() {
iter2 = *(void ***)iter2;
}
- delete _pages[i].start;
+ ::free(_pages[i].start);
++freedPagesCount;
_pages[i].start = NULL;
}