Merge pull request #1807 from hardening/pool_leak
Fix Thread handle leak
This commit is contained in:
commit
8f24648c59
@ -103,6 +103,11 @@ static void* thread_pool_work_func(void* arg)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void threads_close(void *thread)
|
||||
{
|
||||
CloseHandle(thread);
|
||||
}
|
||||
|
||||
void InitializeThreadpool(PTP_POOL pool)
|
||||
{
|
||||
int index;
|
||||
@ -114,6 +119,7 @@ void InitializeThreadpool(PTP_POOL pool)
|
||||
pool->Maximum = 500;
|
||||
|
||||
pool->Threads = ArrayList_New(TRUE);
|
||||
pool->Threads->object.fnObjectFree = threads_close;
|
||||
|
||||
pool->PendingQueue = Queue_New(TRUE, -1, -1);
|
||||
pool->WorkComplete = CountdownEvent_New(0);
|
||||
|
Loading…
Reference in New Issue
Block a user