aboutsummaryrefslogtreecommitdiff
path: root/core/thread
diff options
context:
space:
mode:
authorjharler <jharler@gmail.com>2020-05-11 12:32:35 -0400
committerjharler <jharler@gmail.com>2020-05-11 12:32:35 -0400
commit72a5030f3d5d75aa72ab671788ea0c3242a5a3e2 (patch)
treee58859cfdc0407ec9768143a1238d23232bc6b48 /core/thread
parent197a72adde23d93b3243dc1a41d50b04caa0bdef (diff)
Fixed thread_pool not destroying threads
Diffstat (limited to 'core/thread')
-rw-r--r--core/thread/thread_pool.odin5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/thread/thread_pool.odin b/core/thread/thread_pool.odin
index 61d326f0c..8b6b15ece 100644
--- a/core/thread/thread_pool.odin
+++ b/core/thread/thread_pool.odin
@@ -70,6 +70,11 @@ pool_init :: proc(pool: ^Pool, thread_count: int, allocator := context.allocator
pool_destroy :: proc(pool: ^Pool) {
delete(pool.tasks);
+
+ for thread in &pool.threads {
+ destroy(thread);
+ }
+
delete(pool.threads, pool.allocator);
sync.mutex_destroy(&pool.mutex);