소스 검색

remove memory leaks

Bill Hoffman 24 년 전
부모
커밋
e197d3f219

+ 1 - 0
Source/MFCDialog/CMakeSetupDialog.cpp

@@ -773,6 +773,7 @@ void CMakeSetupDialog::OnOk()
 {
   m_CacheEntriesList.ClearDirty();
   this->RunCMake(true);
+  cmMakefileGenerator::UnRegisterGenerators();
   CDialog::OnOK();
 }
 

+ 1 - 1
Source/cmMakefileGenerator.cxx

@@ -52,7 +52,7 @@ void cmMakefileGenerator::SetMakefile(cmMakefile* mf)
 
 void cmMakefileGenerator::UnRegisterGenerators()
 {
-   for(std::map<cmStdString, cmMakefileGenerator*>::iterator i
+  for(std::map<cmStdString, cmMakefileGenerator*>::iterator i
         = s_RegisteredGenerators.begin(); 
       i != s_RegisteredGenerators.end(); ++i)
     {

+ 1 - 1
Source/cmStandardIncludes.h

@@ -131,7 +131,7 @@ inline bool operator==(std::string const& a, const char* b)
 { return (a==std::string(b)); }
 # endif  // end CM_SGI_CC_720
 
-// use this class to shring the size of symbols in .o files
+// use this class to shrink the size of symbols in .o files
 // std::string is really basic_string<....lots of stuff....>
 // when combined with a map or set, the symbols can be > 2000 chars!
 struct cmStdString : public std::string

+ 5 - 0
Source/cmUnixMakefileGenerator.cxx

@@ -53,6 +53,11 @@ cmUnixMakefileGenerator::cmUnixMakefileGenerator()
   m_Recurse = false;
 }
 
+cmUnixMakefileGenerator::~cmUnixMakefileGenerator()
+{
+}
+
+
 void cmUnixMakefileGenerator::GenerateMakefile()
 {
   // suppoirt override in output directories

+ 2 - 0
Source/cmUnixMakefileGenerator.h

@@ -56,6 +56,8 @@ public:
   ///! Set cache only and recurse to false by default.
   cmUnixMakefileGenerator();
 
+  ~cmUnixMakefileGenerator();
+  
   ///! Get the name for the generator.
   virtual const char* GetName() {return "Unix Makefiles";}
 

+ 4 - 1
Source/cmakemain.cxx

@@ -1,4 +1,5 @@
 #include "cmake.h"
+#include "cmMakefileGenerator.h"
 
 int main(int ac, char** av)
 {
@@ -8,5 +9,7 @@ int main(int ac, char** av)
     {
     args.push_back(av[i]);
     }
-  return cm.Generate(args);
+  int ret = cm.Generate(args);
+  cmMakefileGenerator::UnRegisterGenerators();
+  return ret;
 }