summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2008-09-04 21:02:25 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2008-09-04 21:02:25 (GMT)
commitbf796f1434fd049ec77f7df5d4b8126b0d6ab96a (patch)
tree34d508dec390e3bd58ebc8f9e81124bce3488a54
parent4bf27d31fc0f6d4407baf53d7764ac35eeba8d3a (diff)
downloadCMake-bf796f1434fd049ec77f7df5d4b8126b0d6ab96a.zip
CMake-bf796f1434fd049ec77f7df5d4b8126b0d6ab96a.tar.gz
CMake-bf796f1434fd049ec77f7df5d4b8126b0d6ab96a.tar.bz2
BUG: fix extra close that killed cmake when being debugged
-rw-r--r--Source/cmWin32ProcessExecution.cxx22
1 files changed, 7 insertions, 15 deletions
diff --git a/Source/cmWin32ProcessExecution.cxx b/Source/cmWin32ProcessExecution.cxx
index 67ceaef..f383805 100644
--- a/Source/cmWin32ProcessExecution.cxx
+++ b/Source/cmWin32ProcessExecution.cxx
@@ -715,18 +715,24 @@ bool cmWin32ProcessExecution::CloseHandles()
{
if(this->pStdErr != -1 )
{
+ // this will close this as well: this->hChildStderrRdDup
_close(this->pStdErr);
this->pStdErr = -1;
+ this->hChildStderrRdDup = 0;
}
if(this->pStdIn != -1 )
{
+ // this will close this as well: this->hChildStdinWrDup
_close(this->pStdIn);
this->pStdIn = -1;
+ this->hChildStdinWrDup = 0;
}
if(this->pStdOut != -1 )
{
+ // this will close this as well: this->hChildStdoutRdDup
_close(this->pStdOut);
this->pStdOut = -1;
+ this->hChildStdoutRdDup = 0;
}
bool ret = true;
@@ -735,21 +741,7 @@ bool cmWin32ProcessExecution::CloseHandles()
ret = false;
}
this->hChildStdinRd = 0;
- if(this->hChildStdoutRdDup && !CloseHandle(this->hChildStdoutRdDup))
- {
- ret = false;
- }
- this->hChildStdoutRdDup = 0;
- if(this->hChildStderrRdDup && !CloseHandle(this->hChildStderrRdDup))
- {
- ret = false;
- }
- this->hChildStderrRdDup = 0;
- if(this->hChildStdinWrDup && !CloseHandle(this->hChildStdinWrDup))
- {
- ret = false;
- }
- this->hChildStdinWrDup = 0;
+ // now close these two
if (this->hChildStdoutWr && !CloseHandle(this->hChildStdoutWr))
{
ret = false;