diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2004-05-05 14:13:19 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2004-05-05 14:13:19 (GMT) |
commit | 23798f8a220093598270ef272dc1b1845c5729f4 (patch) | |
tree | fa11caf4592d1cb1f317479096bf26ee004bc3da /Source/cmake.cxx | |
parent | 22de04fab9d440126e2b215291ae4ae3a6d91639 (diff) | |
download | CMake-23798f8a220093598270ef272dc1b1845c5729f4.zip CMake-23798f8a220093598270ef272dc1b1845c5729f4.tar.gz CMake-23798f8a220093598270ef272dc1b1845c5729f4.tar.bz2 |
ENH: Remove memory leak
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r-- | Source/cmake.cxx | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx index b3fc121..5c0dd75 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -49,6 +49,7 @@ #endif #endif +#include <memory> // auto_ptr void cmNeedBackwardsCompatibility(const std::string& variable, int access_type, void* ) @@ -57,7 +58,12 @@ void cmNeedBackwardsCompatibility(const std::string& variable, { std::string message = "An attempt was made to access a variable: "; message += variable; - message += " that has not been defined. Some variables were always defined by CMake in versions prior to 1.6. To fix this you might need to set the cache value of CMAKE_BACKWARDS_COMPATIBILITY to 1.4 or less. If you are writing a CMakeList file, (or have already set CMAKE_BACKWARDS_COMPATABILITY to 1.4 or less) then you probably need to include a CMake module to test for the feature this variable defines."; + message += " that has not been defined. Some variables were always defined " + "by CMake in versions prior to 1.6. To fix this you might need to set the " + "cache value of CMAKE_BACKWARDS_COMPATIBILITY to 1.4 or less. If you are " + "writing a CMakeList file, (or have already set " + "CMAKE_BACKWARDS_COMPATABILITY to 1.4 or less) then you probably need to " + "include a CMake module to test for the feature this variable defines."; cmSystemTools::Error(message.c_str()); } } @@ -248,7 +254,7 @@ void cmake::ReadListFile(const char *path) // read in the list file to fill the cache if(path) { - cmLocalGenerator *lg = gg->CreateLocalGenerator(); + std::auto_ptr<cmLocalGenerator> lg(gg->CreateLocalGenerator()); lg->SetGlobalGenerator(gg); if (!lg->GetMakefile()->ReadListFile(0, path)) { |