Add a PreCleanPool() static method to pool item types.

This commit is contained in:
Jonathan G Rennison
2017-03-04 23:39:27 +00:00
parent 212f6ce6ef
commit 87142ed840
2 changed files with 8 additions and 0 deletions

View File

@@ -196,6 +196,7 @@ DEFINE_POOL_METHOD(void)::FreeItem(size_t index)
DEFINE_POOL_METHOD(void)::CleanPool()
{
this->cleaning = true;
Titem::PreCleanPool();
for (size_t i = 0; i < this->first_unused; i++) {
delete this->Get(i); // 'delete NULL;' is very valid
}