diff --git a/thpool.c b/thpool.c index 83885c3..2262ac2 100644 --- a/thpool.c +++ b/thpool.c @@ -254,6 +254,7 @@ void thpool_destroy(thpool_* thpool_p){ /* Deallocs */ int n; for (n=0; n < threads_total; n++){ + pthread_join(thpool_p->threads[n]->pthread, NULL); thread_destroy(thpool_p->threads[n]); } free(thpool_p->threads);