Browse Source

Fixed thread_pool not destroying threads

jharler 5 years ago
parent
commit
72a5030f3d
1 changed files with 5 additions and 0 deletions
  1. 5 0
      core/thread/thread_pool.odin

+ 5 - 0
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);