diff options
Diffstat (limited to 'src/thread_pool.cpp')
| -rw-r--r-- | src/thread_pool.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/thread_pool.cpp b/src/thread_pool.cpp index ba150bb6f..a1ee11523 100644 --- a/src/thread_pool.cpp +++ b/src/thread_pool.cpp @@ -57,14 +57,9 @@ gb_internal void thread_pool_destroy(ThreadPool *pool) { for_array(i, pool->threads) { Thread *t = &pool->threads[i]; - thread_join(t); + thread_join_and_destroy(t); } - - for_array(i, pool->threads) { - Thread *t = &pool->threads[i]; - thread_destroy(t); - } - + gb_free(pool->allocator, pool->threads.data); mutex_destroy(&pool->mutex); condition_destroy(&pool->task_cond); |