diff options
author | Ken Martin <ken.martin@kitware.com> | 2006-07-12 18:15:06 (GMT) |
---|---|---|
committer | Ken Martin <ken.martin@kitware.com> | 2006-07-12 18:15:06 (GMT) |
commit | 8ace577a2a6471326639a5cadd855257c0290350 (patch) | |
tree | 5c97ec56eb338c729d7073a40a44da764719683d /Source/cmMakefileTargetGenerator.cxx | |
parent | ed54b93533c00d4f4ecbbbb7dfe82d7c238b30a5 (diff) | |
download | CMake-8ace577a2a6471326639a5cadd855257c0290350.zip CMake-8ace577a2a6471326639a5cadd855257c0290350.tar.gz CMake-8ace577a2a6471326639a5cadd855257c0290350.tar.bz2 |
BUG: reduce the number of file handles kept open
Diffstat (limited to 'Source/cmMakefileTargetGenerator.cxx')
-rw-r--r-- | Source/cmMakefileTargetGenerator.cxx | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 88521dd..130aebe 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -33,7 +33,6 @@ cmMakefileTargetGenerator::cmMakefileTargetGenerator() { this->BuildFileStream = 0; - this->ProgressFileStream = 0; this->InfoFileStream = 0; this->FlagFileStream = 0; } @@ -92,13 +91,6 @@ void cmMakefileTargetGenerator::CreateRuleFile() this->ProgressFileNameFull = this->TargetBuildDirectoryFull; this->ProgressFileNameFull += "/progress.make"; - this->ProgressFileStream = - new cmGeneratedFileStream(this->ProgressFileNameFull.c_str()); - if(!this->ProgressFileStream) - { - return; - } - // reset the progress count this->NumberOfProgressActions = 0; @@ -1055,29 +1047,36 @@ void cmMakefileTargetGenerator::RemoveForbiddenFlags(const char* flagVar, void cmMakefileTargetGenerator::WriteProgressVariables(unsigned long total, unsigned long ¤t) { + cmGeneratedFileStream *progressFileStream = + new cmGeneratedFileStream(this->ProgressFileNameFull.c_str()); + if(!progressFileStream) + { + return; + } + unsigned long num; unsigned long i; for (i = 1; i <= this->NumberOfProgressActions; ++i) { - *this->ProgressFileStream + *progressFileStream << "CMAKE_PROGRESS_" << i << " = "; if (total <= 100) { num = i + current; - *this->ProgressFileStream << num; + *progressFileStream << num; this->LocalGenerator->ProgressFiles[this->Target->GetName()] .push_back(num); } else if (((i+current)*100)/total > ((i-1+current)*100)/total) { num = ((i+current)*100)/total; - *this->ProgressFileStream << num; + *progressFileStream << num; this->LocalGenerator->ProgressFiles[this->Target->GetName()] .push_back(num); } - *this->ProgressFileStream << "\n"; + *progressFileStream << "\n"; } current += this->NumberOfProgressActions; - delete this->ProgressFileStream; + delete progressFileStream; } |