소스 검색

Fixed exit code retrieval of spawned processes on Windows

Use GetExitCodeProcess() on Windows to retrieve the exit code of a process in
OS:excute()

(cherry picked from commit f0f4220b05763067e9af9716a9f0a485da971c78)
Marcus Brummer 4 년 전
부모
커밋
a822bb9844
1개의 변경된 파일3개의 추가작업 그리고 2개의 파일을 삭제
  1. 3 2
      platform/windows/os_windows.cpp

+ 3 - 2
platform/windows/os_windows.cpp

@@ -2944,9 +2944,10 @@ Error OS_Windows::execute(const String &p_path, const List<String> &p_arguments,
 	ERR_FAIL_COND_V(ret == 0, ERR_CANT_FORK);
 
 	if (p_blocking) {
-
-		DWORD ret2 = WaitForSingleObject(pi.pi.hProcess, INFINITE);
+		WaitForSingleObject(pi.pi.hProcess, INFINITE);
 		if (r_exitcode) {
+			DWORD ret2;
+			GetExitCodeProcess(pi.pi.hProcess, &ret2);
 			*r_exitcode = ret2;
 		}