summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2009-12-28 18:44:38 (GMT)
committerDavid Cole <david.cole@kitware.com>2009-12-28 18:44:38 (GMT)
commit474cf519a03c744b0fc28630d33fb5abb42eda80 (patch)
tree6242fa8ea8c4810f4eadd106866df2c4336fd859 /Source
parent10a4abddfd782a75afbd85b50087f5b9deea6dcc (diff)
downloadCMake-474cf519a03c744b0fc28630d33fb5abb42eda80.zip
CMake-474cf519a03c744b0fc28630d33fb5abb42eda80.tar.gz
CMake-474cf519a03c744b0fc28630d33fb5abb42eda80.tar.bz2
Fix mem leak reported by valgrind.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmake.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 6a50ccc..4ec72f0 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -4397,7 +4397,7 @@ int cmake::Build(const std::string& dir,
const std::string& config,
const std::vector<std::string>& nativeOptions,
bool clean)
-{
+{
if(!cmSystemTools::FileIsDirectory(dir.c_str()))
{
std::cerr << "Error: " << dir << " is not a directory\n";
@@ -4417,8 +4417,8 @@ int cmake::Build(const std::string& dir,
std::cerr << "Error: could find generator in Cache\n";
return 1;
}
- cmGlobalGenerator* gen =
- this->CreateGlobalGenerator(it.GetValue());
+ std::auto_ptr<cmGlobalGenerator> gen(
+ this->CreateGlobalGenerator(it.GetValue()));
std::string output;
std::string projName;
std::string makeProgram;