diff options
author | Robin Gareus <robin@gareus.org> | 2014-07-11 17:03:55 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2014-07-11 17:03:55 +0200 |
commit | 12025d4ffa5ace1e2eff3015112997287f9bfeaa (patch) | |
tree | 70bc18036a7601978fcadd405417dbd9858f3197 /libs | |
parent | c83b7ebc3ca4b9e2266ec355e9e848d7d62d86b4 (diff) |
possible fix for win SystemExec::wait()
if it does not help, use CREATE_NO_WINDOW and/or peek/pump messages :(
Diffstat (limited to 'libs')
-rw-r--r-- | libs/pbd/system_exec.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/libs/pbd/system_exec.cc b/libs/pbd/system_exec.cc index 01c46aa9eb..123fb909ad 100644 --- a/libs/pbd/system_exec.cc +++ b/libs/pbd/system_exec.cc @@ -413,8 +413,7 @@ int SystemExec::wait (int options) { while (is_running()) { - WaitForSingleObject(pid->hProcess, INFINITE); - Sleep(20); + WaitForSingleObject(pid->hProcess, 40); } return 0; } @@ -422,7 +421,12 @@ SystemExec::wait (int options) bool SystemExec::is_running () { - return pid?true:false; + if (!pid) return false; + DWORD exit_code; + if (GetExitCodeProcess(pid->hProcess, &exit_code)) { + if (exit_code == STILL_ACTIVE) return true; + } + return false; } int |