BUG: Fixed reusability of process object by clearing each pipe's Closed flag when cleaning up.

This commit is contained in:
Brad King 2005-07-07 09:05:59 -04:00
parent 132eaa1ab3
commit 7e7249cbd1
1 changed files with 2 additions and 1 deletions

View File

@ -1431,7 +1431,7 @@ int kwsysProcess_WaitForExit(kwsysProcess* cp, double* userTimeout)
}
/* When the last pipe closes in WaitForData, the loop terminates
without releaseing the pipe's thread. Release it now. */
without releasing the pipe's thread. Release it now. */
if(cp->CurrentIndex < KWSYSPE_PIPE_COUNT)
{
ReleaseSemaphore(cp->Pipe[cp->CurrentIndex].Reader.Go, 1, 0);
@ -2076,6 +2076,7 @@ void kwsysProcessCleanup(kwsysProcess* cp, int error)
{
kwsysProcessCleanupHandle(&cp->Pipe[i].Write);
kwsysProcessCleanupHandle(&cp->Pipe[i].Read);
cp->Pipe[i].Closed = 0;
}
}