浏览代码

Allow Godot to kill it's own PID

Ev1lbl0w 5 年之前
父节点
当前提交
75ce45440a
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7 0
      platform/windows/os_windows.cpp

+ 7 - 0
platform/windows/os_windows.cpp

@@ -212,6 +212,13 @@ void OS_Windows::initialize() {
 
 
 	process_map = memnew((Map<ProcessID, ProcessInfo>));
 	process_map = memnew((Map<ProcessID, ProcessInfo>));
 
 
+	// Add current Godot PID to the list of known PIDs
+	ProcessInfo current_pi = {};
+	PROCESS_INFORMATION current_pi_pi = {};
+	current_pi.pi = current_pi_pi;
+	current_pi.pi.hProcess = GetCurrentProcess();
+	process_map->insert(GetCurrentProcessId(), current_pi);
+
 	IP_Unix::make_default();
 	IP_Unix::make_default();
 	main_loop = nullptr;
 	main_loop = nullptr;
 }
 }