summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-06-16 20:49:00 +0200
committerGitHub <noreply@github.com>2020-06-16 20:49:00 +0200
commitfa01e666d2d3dd9fe0ca8fbbea19ca2e2458cf29 (patch)
treef4e62409111e1496b4f43dd4bbe53ae47ed28be7
parent93d79023adde71771a3046327846c3cd07c4e29e (diff)
parent75ce45440a9a2cd6363b5f04205d201dba6dec5d (diff)
Merge pull request #39542 from Ev1lbl0w/feature/kill-pid
Allow Godot to kill its own PID
-rw-r--r--platform/windows/os_windows.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp
index 9c1b8f2949..5b15896b0c 100644
--- a/platform/windows/os_windows.cpp
+++ b/platform/windows/os_windows.cpp
@@ -208,6 +208,13 @@ void OS_Windows::initialize() {
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();
main_loop = nullptr;
}