浏览代码

[core:thread] Fix compilation

hikari 2 年之前
父节点
当前提交
7b62b81ebd
共有 2 个文件被更改,包括 4 次插入0 次删除
  1. 2 0
      core/thread/thread_unix.odin
  2. 2 0
      core/thread/thread_windows.odin

+ 2 - 0
core/thread/thread_unix.odin

@@ -69,6 +69,8 @@ _create :: proc(procedure: Thread_Proc, priority: Thread_Priority) -> ^Thread {
 
 		if t.self_cleanup {
 			t.unix_thread = {}
+			// NOTE(ftphikari): It doesn't matter which context 'free' received, right?
+			context = {}
 			free(t, t.creation_allocator)
 		}
 

+ 2 - 0
core/thread/thread_windows.odin

@@ -50,6 +50,8 @@ _create :: proc(procedure: Thread_Proc, priority: Thread_Priority) -> ^Thread {
 		if t.self_cleanup {
 			win32.CloseHandle(t.win32_thread)
 			t.win32_thread = win32.INVALID_HANDLE
+			// NOTE(ftphikari): It doesn't matter which context 'free' received, right?
+			context = {}
 			free(t, t.creation_allocator)
 		}