summaryrefslogtreecommitdiffstats
path: root/Source/cmCTest.cxx
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2004-05-05 14:13:19 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2004-05-05 14:13:19 (GMT)
commit23798f8a220093598270ef272dc1b1845c5729f4 (patch)
treefa11caf4592d1cb1f317479096bf26ee004bc3da /Source/cmCTest.cxx
parent22de04fab9d440126e2b215291ae4ae3a6d91639 (diff)
downloadCMake-23798f8a220093598270ef272dc1b1845c5729f4.zip
CMake-23798f8a220093598270ef272dc1b1845c5729f4.tar.gz
CMake-23798f8a220093598270ef272dc1b1845c5729f4.tar.bz2
ENH: Remove memory leak
Diffstat (limited to 'Source/cmCTest.cxx')
-rw-r--r--Source/cmCTest.cxx8
1 files changed, 5 insertions, 3 deletions
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index 821a346..377e688 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -21,6 +21,7 @@
#include "cmGlobalGenerator.h"
#include <cmsys/Directory.hxx>
#include "cmGlob.h"
+#include "cmDynamicLoader.h"
#include "cmCTestSubmit.h"
#include "curl/curl.h"
@@ -33,7 +34,8 @@
#include <time.h>
#include <math.h>
#include <float.h>
-#include "cmDynamicLoader.h"
+
+#include <memory> // auto_ptr
#define SAFEDIV(x,y) (((y)!=0)?((x)/(y)):(0))
#define DEBUGOUT std::cout << __LINE__ << " "; std::cout
@@ -3499,7 +3501,7 @@ int cmCTest::RunConfigurationScript(const std::string& total_script_arg)
gg.SetCMakeInstance(&cm);
// read in the list file to fill the cache
- cmLocalGenerator *lg = gg.CreateLocalGenerator();
+ std::auto_ptr<cmLocalGenerator> lg(gg.CreateLocalGenerator());
lg->SetGlobalGenerator(&gg);
// set a variable with the path to the current script
@@ -4930,7 +4932,7 @@ int cmCTest::ReadCustomConfigurationFileTree(const char* dir)
cmake cm;
cmGlobalGenerator gg;
gg.SetCMakeInstance(&cm);
- cmLocalGenerator *lg = gg.CreateLocalGenerator();
+ std::auto_ptr<cmLocalGenerator> lg(gg.CreateLocalGenerator());
lg->SetGlobalGenerator(&gg);
cmMakefile *mf = lg->GetMakefile();