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 * php7_ext_wrapper.h add more macro defines
* compile passed in FreeBSD 10.2 * compile passed in FreeBSD 10.2
* bugfixed: free task point correctly in free_queue_destroy
Version 1.24 2016-02-15 Version 1.24 2016-02-15
* php extension compiled on PHP 7 * php extension compiled on PHP 7

View File

@ -313,9 +313,11 @@ void free_queue_destroy()
char *pCharEnd; char *pCharEnd;
struct fast_task_info *pTask; struct fast_task_info *pTask;
pCharEnd = ((char *)g_mpool.head->blocks) + g_free_queue.block_size * mpool = g_mpool.head;
g_free_queue.alloc_connections; while (mpool != NULL)
for (p=(char *)g_mpool.head->blocks; p<pCharEnd; p += g_free_queue.block_size) {
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; pTask = (struct fast_task_info *)p;
if (pTask->data != NULL) if (pTask->data != NULL)
@ -324,6 +326,8 @@ void free_queue_destroy()
pTask->data = NULL; pTask->data = NULL;
} }
} }
mpool = mpool->next;
}
} }
mpool = g_mpool.head; mpool = g_mpool.head;