bugfixed: free task point correctly in free_queue_destroy

pull/10/head
yuqing 2016-02-22 18:34:41 +08:00
parent e32e6315b5
commit 09bc970dab
2 changed files with 17 additions and 12 deletions

View File

@ -1,6 +1,7 @@
Version 1.25 2016-02-19
Version 1.25 2016-02-22
* php7_ext_wrapper.h add more macro defines
* compile passed in FreeBSD 10.2
* bugfixed: free task point correctly in free_queue_destroy
Version 1.24 2016-02-15
* php extension compiled on PHP 7

View File

@ -313,17 +313,21 @@ void free_queue_destroy()
char *pCharEnd;
struct fast_task_info *pTask;
pCharEnd = ((char *)g_mpool.head->blocks) + g_free_queue.block_size *
g_free_queue.alloc_connections;
for (p=(char *)g_mpool.head->blocks; p<pCharEnd; p += g_free_queue.block_size)
{
pTask = (struct fast_task_info *)p;
if (pTask->data != NULL)
{
free(pTask->data);
pTask->data = NULL;
}
}
mpool = g_mpool.head;
while (mpool != NULL)
{
pCharEnd = (char *)mpool->last_block + g_free_queue.block_size;
for (p=(char *)mpool->blocks; p<pCharEnd; p += g_free_queue.block_size)
{
pTask = (struct fast_task_info *)p;
if (pTask->data != NULL)
{
free(pTask->data);
pTask->data = NULL;
}
}
mpool = mpool->next;
}
}
mpool = g_mpool.head;