summaryrefslogtreecommitdiffstats
path: root/Source/cmDSWWriter.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2001-06-04 14:18:03 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2001-06-04 14:18:03 (GMT)
commita3cfcd9894a5d626b8beba80fc8b5934ea3f46cf (patch)
tree73155ed903d3138946d64f4da4631954c8601b4e /Source/cmDSWWriter.cxx
parentabab6bc00069df6ff1988abced39b98ea199febc (diff)
downloadCMake-a3cfcd9894a5d626b8beba80fc8b5934ea3f46cf.zip
CMake-a3cfcd9894a5d626b8beba80fc8b5934ea3f46cf.tar.gz
CMake-a3cfcd9894a5d626b8beba80fc8b5934ea3f46cf.tar.bz2
BUG: clean up memory leaks.
Diffstat (limited to 'Source/cmDSWWriter.cxx')
-rw-r--r--Source/cmDSWWriter.cxx15
1 files changed, 12 insertions, 3 deletions
diff --git a/Source/cmDSWWriter.cxx b/Source/cmDSWWriter.cxx
index cd3feb7..0823869 100644
--- a/Source/cmDSWWriter.cxx
+++ b/Source/cmDSWWriter.cxx
@@ -96,7 +96,6 @@ void cmDSWMakefile::WriteDSWFile(std::ostream& fout)
// add a special target that depends on ALL projects for easy build
// of Debug only
m_Makefile->AddUtilityCommand("ALL_BUILD", "echo \"Build all projects\"", false);
-
m_Makefile->FindSubDirectoryCMakeListsFiles(allListFiles);
// For each cmMakefile, create a DSP for it, and
// add it to this DSW file
@@ -104,8 +103,18 @@ void cmDSWMakefile::WriteDSWFile(std::ostream& fout)
k != allListFiles.end(); ++k)
{
cmMakefile* mf = *k;
- // Create an MS generator with DSW off, so it only creates dsp files
- cmMSProjectGenerator* pg = new cmMSProjectGenerator;
+ cmMSProjectGenerator* pg = 0;
+ // if not this makefile, then create a new generator
+ if(m_Makefile != mf)
+ {
+ // Create an MS generator with DSW off, so it only creates dsp files
+ pg = new cmMSProjectGenerator;
+ }
+ else
+ {
+ pg = (cmMSProjectGenerator*)m_Makefile->GetMakefileGenerator();
+ }
+ // make sure the generator is building dsp files
pg->BuildDSWOff();
mf->SetMakefileGenerator(pg);
mf->GenerateMakefile();