summaryrefslogtreecommitdiff
path: root/src/oldpool.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-08-05 21:20:55 +0000
committerrubidium <rubidium@openttd.org>2007-08-05 21:20:55 +0000
commit83e1fdcb0167c36729889511f7b1165038044c88 (patch)
treebfe043c51f23052fc39f35769a2ede1e66998148 /src/oldpool.cpp
parentab5fa3add2f5f2feeb8f48127f6ee5ab69d42f65 (diff)
downloadopenttd-83e1fdcb0167c36729889511f7b1165038044c88.tar.xz
(svn r10799) -Fix: only calling QuickFree and not the destructor on pool cleanups might cause memory leaks due to the way C++ works.
Diffstat (limited to 'src/oldpool.cpp')
-rw-r--r--src/oldpool.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/oldpool.cpp b/src/oldpool.cpp
index 3cc5c8391..df4731777 100644
--- a/src/oldpool.cpp
+++ b/src/oldpool.cpp
@@ -18,6 +18,7 @@ void OldMemoryPoolBase::CleanPool()
DEBUG(misc, 4, "[Pool] (%s) cleaning pool..", this->name);
+ this->cleaning_pool = true;
/* Free all blocks */
for (i = 0; i < this->current_blocks; i++) {
if (this->clean_block_proc != NULL) {
@@ -25,6 +26,7 @@ void OldMemoryPoolBase::CleanPool()
}
free(this->blocks[i]);
}
+ this->cleaning_pool = false;
/* Free the block itself */
free(this->blocks);