[Cmake-commits] CMake branch, next, updated. v3.0.0-rc4-2475-g5190144

Nils Gladitz nilsgladitz at gmail.com
Fri Apr 18 17:26:24 EDT 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  5190144cdf0a6636929dcaab271844b2306ef940 (commit)
       via  cb59f5da97723f648df78fd16d95697008d5d42b (commit)
      from  9a0b331674b4965af86188d660221c2482466ae0 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5190144cdf0a6636929dcaab271844b2306ef940
commit 5190144cdf0a6636929dcaab271844b2306ef940
Merge: 9a0b331 cb59f5d
Author:     Nils Gladitz <nilsgladitz at gmail.com>
AuthorDate: Fri Apr 18 17:26:23 2014 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Apr 18 17:26:23 2014 -0400

    Merge topic 'fix-wix-cpack-crash' into next
    
    cb59f5da CPackWIX: Delay creation of cmWIXPatch until CPack has initialized Logger


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cb59f5da97723f648df78fd16d95697008d5d42b
commit cb59f5da97723f648df78fd16d95697008d5d42b
Author:     Nils Gladitz <nilsgladitz at gmail.com>
AuthorDate: Fri Apr 18 22:45:30 2014 +0200
Commit:     Nils Gladitz <nilsgladitz at gmail.com>
CommitDate: Fri Apr 18 22:45:30 2014 +0200

    CPackWIX: Delay creation of cmWIXPatch until CPack has initialized Logger
    
    Without the fix CPack will crash when the cmWIXPatch class tries to issue
    any diagnostics.

diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
index a385e40..ec59715 100644
--- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx
+++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
@@ -33,14 +33,23 @@
 
 cmCPackWIXGenerator::cmCPackWIXGenerator():
   HasDesktopShortcuts(false),
-  Patch(Logger)
+  Patch(0)
 {
 
 }
 
+cmCPackWIXGenerator::~cmCPackWIXGenerator()
+{
+  if(this->Patch)
+    {
+    delete this->Patch;
+    }
+}
+
 int cmCPackWIXGenerator::InitializeInternal()
 {
   componentPackageMethod = ONE_PACKAGE;
+  this->Patch = new cmWIXPatch(this->Logger);
 
   return this->Superclass::InitializeInternal();
 }
@@ -232,7 +241,7 @@ bool cmCPackWIXGenerator::InitializeWiXConfiguration()
   const char* patchFilePath = GetOption("CPACK_WIX_PATCH_FILE");
   if(patchFilePath)
     {
-    this->Patch.LoadFragments(patchFilePath);
+    this->Patch->LoadFragments(patchFilePath);
     }
 
   return true;
@@ -525,7 +534,7 @@ bool cmCPackWIXGenerator::CreateWiXSourceFiles()
     return false;
     }
 
-  return this->Patch.CheckForUnappliedFragments();
+  return this->Patch->CheckForUnappliedFragments();
 }
 
 std::string cmCPackWIXGenerator::GetProgramFilesFolderId() const
@@ -857,13 +866,13 @@ void cmCPackWIXGenerator::AddDirectoryAndFileDefinitons(
         desktopExecutables,
         shortcutMap);
 
-      this->Patch.ApplyFragment(subDirectoryId, directoryDefinitions);
+      this->Patch->ApplyFragment(subDirectoryId, directoryDefinitions);
       directoryDefinitions.EndElement("Directory");
       }
     else
       {
       std::string componentId = fileDefinitions.EmitComponentFile(
-        directoryId, id, fullPath, this->Patch);
+        directoryId, id, fullPath, *(this->Patch));
 
       featureDefinitions.EmitComponentRef(componentId);
 
diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.h b/Source/CPack/WiX/cmCPackWIXGenerator.h
index 4c9f8c7..8705d40 100644
--- a/Source/CPack/WiX/cmCPackWIXGenerator.h
+++ b/Source/CPack/WiX/cmCPackWIXGenerator.h
@@ -35,6 +35,7 @@ public:
   cmCPackTypeMacro(cmCPackWIXGenerator, cmCPackGenerator);
 
   cmCPackWIXGenerator();
+  ~cmCPackWIXGenerator();
 
 protected:
   virtual int InitializeInternal();
@@ -166,7 +167,7 @@ private:
 
   std::string CPackTopLevel;
 
-  cmWIXPatch Patch;
+  cmWIXPatch* Patch;
 };
 
 #endif

-----------------------------------------------------------------------

Summary of changes:
 Source/CPack/WiX/cmCPackWIXGenerator.cxx |   19 ++++++++++++++-----
 Source/CPack/WiX/cmCPackWIXGenerator.h   |    3 ++-
 2 files changed, 16 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list