瀏覽代碼

Merge pull request #638 from jharler/master

Fixed thread_pool not destroying threads
gingerBill 5 年之前
父節點
當前提交
d49ecd9009
共有 1 個文件被更改,包括 5 次插入0 次删除
  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);