possible fix for win SystemExec::wait()

if it does not help, use CREATE_NO_WINDOW and/or peek/pump messages :(
This commit is contained in:
Robin Gareus 2014-07-11 17:03:55 +02:00
parent c83b7ebc3c
commit 12025d4ffa

View File

@ -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