diff src/oldpool.cpp @ 7413:571c87eed06c draft

(svn r10799) -Fix: only calling QuickFree and not the destructor on pool cleanups might cause memory leaks due to the way C++ works.
author rubidium <rubidium@openttd.org>
date Sun, 05 Aug 2007 21:20:55 +0000
parents b65f9fb4175f
children 515808dcc91c
line wrap: on
line diff
--- a/src/oldpool.cpp
+++ b/src/oldpool.cpp
@@ -18,6 +18,7 @@
 
 	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 @@
 		}
 		free(this->blocks[i]);
 	}
+	this->cleaning_pool = false;
 
 	/* Free the block itself */
 	free(this->blocks);