From 474cf519a03c744b0fc28630d33fb5abb42eda80 Mon Sep 17 00:00:00 2001 From: David Cole Date: Mon, 28 Dec 2009 13:44:38 -0500 Subject: Fix mem leak reported by valgrind. --- Source/cmake.cxx | 6 +++--- 1 file 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& 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 gen( + this->CreateGlobalGenerator(it.GetValue())); std::string output; std::string projName; std::string makeProgram; -- cgit v0.12