ENH: fix memory leak

This commit is contained in:
Bill Hoffman 2007-08-10 11:15:19 -04:00
parent 40e55ab780
commit 8b07c96090

View File

@ -2406,12 +2406,14 @@ int cmake::CheckBuildSystem()
{
genName = "Unix Makefiles";
}
cmGlobalGenerator *ggd = this->CreateGlobalGenerator(genName);
if (ggd)
// this global generator is never set to the cmake object so it is never
// deleted, so make it an auto_ptr
std::auto_ptr<cmGlobalGenerator> ggd(this->CreateGlobalGenerator(genName));
if (ggd.get())
{
// Check the dependencies in case source files were removed.
std::auto_ptr<cmLocalGenerator> lgd(ggd->CreateLocalGenerator());
lgd->SetGlobalGenerator(ggd);
lgd->SetGlobalGenerator(ggd.get());
lgd->CheckDependencies(mf, verbose, this->ClearBuildSystem);
// Check for multiple output pairs.