summaryrefslogtreecommitdiffstats
path: root/Source/cmake.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-07-28 14:47:02 (GMT)
committerBrad King <brad.king@kitware.com>2009-07-28 14:47:02 (GMT)
commite9d7ebb3ec751528a422108b20dc3c24fcd39530 (patch)
tree07660eabb01ffed7532d15fb915e608d8c6bb3a7 /Source/cmake.cxx
parent57057ee59550980e19d5c4535d3ec0f4734653a0 (diff)
downloadCMake-e9d7ebb3ec751528a422108b20dc3c24fcd39530.zip
CMake-e9d7ebb3ec751528a422108b20dc3c24fcd39530.tar.gz
CMake-e9d7ebb3ec751528a422108b20dc3c24fcd39530.tar.bz2
BUG: Do not double-initialize local generators
All global generator CreateLocalGenerator methods automatically initialize the local generator instances with SetGlobalGenerator. In several places we were calling SetGlobalGenerator again after receiving the return value from CreateLocalGenerator. The double-initializations leaked the resources allocated by the first call to SetGlobalGenerator. This fix removes the unnecessary calls.
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r--Source/cmake.cxx5
1 files changed, 0 insertions, 5 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index efc8da0..649bdf8 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -500,7 +500,6 @@ void cmake::ReadListFile(const char *path)
if(path)
{
std::auto_ptr<cmLocalGenerator> lg(gg->CreateLocalGenerator());
- lg->SetGlobalGenerator(gg);
lg->GetMakefile()->SetHomeOutputDirectory
(cmSystemTools::GetCurrentWorkingDirectory().c_str());
lg->GetMakefile()->SetStartOutputDirectory
@@ -1532,7 +1531,6 @@ int cmake::ExecuteCMakeCommand(std::vector<std::string>& args)
{
cm.SetGlobalGenerator(ggd);
std::auto_ptr<cmLocalGenerator> lgd(ggd->CreateLocalGenerator());
- lgd->SetGlobalGenerator(ggd);
lgd->GetMakefile()->SetStartDirectory(startDir.c_str());
lgd->GetMakefile()->SetStartOutputDirectory(startOutDir.c_str());
lgd->GetMakefile()->MakeStartDirectoriesCurrent();
@@ -2625,7 +2623,6 @@ int cmake::CheckBuildSystem()
cmGlobalGenerator gg;
gg.SetCMakeInstance(&cm);
std::auto_ptr<cmLocalGenerator> lg(gg.CreateLocalGenerator());
- lg->SetGlobalGenerator(&gg);
cmMakefile* mf = lg->GetMakefile();
if(!mf->ReadListFile(0, this->CheckBuildSystemArgument.c_str()) ||
cmSystemTools::GetErrorOccuredFlag())
@@ -2656,7 +2653,6 @@ int cmake::CheckBuildSystem()
if(ggd.get())
{
std::auto_ptr<cmLocalGenerator> lgd(ggd->CreateLocalGenerator());
- lgd->SetGlobalGenerator(ggd.get());
lgd->ClearDependencies(mf, verbose);
}
}
@@ -2895,7 +2891,6 @@ void cmake::GenerateGraphViz(const char* fileName) const
cmGlobalGenerator ggi;
ggi.SetCMakeInstance(&cm);
std::auto_ptr<cmLocalGenerator> lg(ggi.CreateLocalGenerator());
- lg->SetGlobalGenerator(&ggi);
cmMakefile *mf = lg->GetMakefile();
std::string infile = this->GetHomeOutputDirectory();