Browse Source

Allow Godot to kill it's own PID

(cherry picked from commit 75ce45440a9a2cd6363b5f04205d201dba6dec5d)
Ev1lbl0w 5 years ago
parent
commit
4d7ac36e84
1 changed files with 7 additions and 0 deletions
  1. 7 0
      platform/windows/os_windows.cpp

+ 7 - 0
platform/windows/os_windows.cpp

@@ -255,6 +255,13 @@ void OS_Windows::initialize_core() {
 
 	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();
 
 	cursor_shape = CURSOR_ARROW;