| Index: base/process_util_win.cc
|
| ===================================================================
|
| --- base/process_util_win.cc (revision 80485)
|
| +++ base/process_util_win.cc (working copy)
|
| @@ -464,7 +464,8 @@
|
|
|
| bool WaitForExitCode(ProcessHandle handle, int* exit_code) {
|
| bool success = WaitForExitCodeWithTimeout(handle, exit_code, INFINITE);
|
| - CloseProcessHandle(handle);
|
| + if (!success)
|
| + CloseProcessHandle(handle);
|
| return success;
|
| }
|
|
|
| @@ -476,6 +477,10 @@
|
| if (!::GetExitCodeProcess(handle, &temp_code))
|
| return false;
|
|
|
| + // Only close the handle on success, to give the caller a chance to forcefully
|
| + // terminate the process if he wants to.
|
| + CloseProcessHandle(handle);
|
| +
|
| *exit_code = temp_code;
|
| return true;
|
| }
|
| @@ -539,6 +544,11 @@
|
| return retval;
|
| }
|
|
|
| +bool CrashAwareSleep(ProcessHandle handle, int64 wait_milliseconds) {
|
| + bool retval = WaitForSingleObject(handle, wait_milliseconds) == WAIT_TIMEOUT;
|
| + return retval;
|
| +}
|
| +
|
| bool CleanupProcesses(const std::wstring& executable_name,
|
| int64 wait_milliseconds,
|
| int exit_code,
|
|
|