Merge pull request #2539 from bmiklautz/fix/regression

ObjectPool: fix regression
This commit is contained in:
Norbert Federa 2015-04-14 13:50:33 +02:00
commit 8f64b71d00
1 changed files with 2 additions and 2 deletions

View File

@ -127,6 +127,8 @@ wObjectPool* ObjectPool_New(BOOL synchronized)
if (pool) if (pool)
{ {
pool->capacity = 32;
pool->size = 0;
pool->array = (void**) malloc(sizeof(void*) * pool->capacity); pool->array = (void**) malloc(sizeof(void*) * pool->capacity);
if (!pool->array) if (!pool->array)
{ {
@ -138,8 +140,6 @@ wObjectPool* ObjectPool_New(BOOL synchronized)
if (pool->synchronized) if (pool->synchronized)
InitializeCriticalSectionAndSpinCount(&pool->lock, 4000); InitializeCriticalSectionAndSpinCount(&pool->lock, 4000);
pool->size = 0;
pool->capacity = 32;
} }
return pool; return pool;