Browse Source

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

Brad King 20 years ago
parent
commit
7e7249cbd1
1 changed files with 2 additions and 1 deletions
  1. 2 1
      Source/kwsys/ProcessWin32.c

+ 2 - 1
Source/kwsys/ProcessWin32.c

@@ -1431,7 +1431,7 @@ int kwsysProcess_WaitForExit(kwsysProcess* cp, double* userTimeout)
     }
     }
 
 
   /* When the last pipe closes in WaitForData, the loop terminates
   /* 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)
   if(cp->CurrentIndex < KWSYSPE_PIPE_COUNT)
     {
     {
     ReleaseSemaphore(cp->Pipe[cp->CurrentIndex].Reader.Go, 1, 0);
     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].Write);
     kwsysProcessCleanupHandle(&cp->Pipe[i].Read);
     kwsysProcessCleanupHandle(&cp->Pipe[i].Read);
+    cp->Pipe[i].Closed = 0;
     }
     }
 }
 }