[Scummvm-cvs-logs] scummvm master -> 3a8c243d340632c229380ac3d54c5e5e7ffa25c9

lordhoto lordhoto at gmail.com
Tue Dec 17 00:28:18 CET 2013


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
3a8c243d34 COMMON: Revert "Fix mismatched new/delete in the MemoryPool class".


Commit: 3a8c243d340632c229380ac3d54c5e5e7ffa25c9
    https://github.com/scummvm/scummvm/commit/3a8c243d340632c229380ac3d54c5e5e7ffa25c9
Author: Johannes Schickel (lordhoto at scummvm.org)
Date: 2013-12-16T15:26:50-08:00

Commit Message:
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.

Changed paths:
    common/memorypool.cpp



diff --git a/common/memorypool.cpp b/common/memorypool.cpp
index 3a31fd5..e3742ee 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;
 		}






More information about the Scummvm-git-logs mailing list