소스 검색

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);