diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmTarget.cxx | 17 | ||||
-rw-r--r-- | Source/cmTarget.h | 5 |
2 files changed, 14 insertions, 8 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 6065890..3d6e1b7 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -3696,19 +3696,22 @@ cmTargetLinkInterface const* cmTarget::GetLinkInterface(const char* config) if(i == this->LinkInterface.end()) { // Compute the link interface for this configuration. - cmTargetLinkInterface* iface = this->ComputeLinkInterface(config); + cmsys::auto_ptr<cmTargetLinkInterface> + iface(this->ComputeLinkInterface(config)); // Store the information for this configuration. std::map<cmStdString, cmTargetLinkInterface*>::value_type - entry(config?config:"", iface); + entry(config?config:"", 0); i = this->LinkInterface.insert(entry).first; + i->second = iface.release(); } return i->second; } //---------------------------------------------------------------------------- -cmTargetLinkInterface* cmTarget::ComputeLinkInterface(const char* config) +cmsys::auto_ptr<cmTargetLinkInterface> +cmTarget::ComputeLinkInterface(const char* config) { // Construct the property name suffix for this configuration. std::string suffix = "_"; @@ -3739,14 +3742,14 @@ cmTargetLinkInterface* cmTarget::ComputeLinkInterface(const char* config) // If still not set, there is no link interface. if(!libs) { - return 0; + return cmsys::auto_ptr<cmTargetLinkInterface>(); } // Allocate the interface. - cmTargetLinkInterface* iface = new cmTargetLinkInterface; - if(!iface) + cmsys::auto_ptr<cmTargetLinkInterface> iface(new cmTargetLinkInterface); + if(!iface.get()) { - return 0; + return cmsys::auto_ptr<cmTargetLinkInterface>(); } // Expand the list of libraries in the interface. diff --git a/Source/cmTarget.h b/Source/cmTarget.h index 12b8bb4..9e17d60 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -21,6 +21,8 @@ #include "cmPropertyMap.h" #include "cmPolicies.h" +#include <cmsys/auto_ptr.hxx> + class cmake; class cmMakefile; class cmSourceFile; @@ -533,7 +535,8 @@ private: cmTargetLinkInformationMap LinkInformation; // Link interface. - cmTargetLinkInterface* ComputeLinkInterface(const char* config); + cmsys::auto_ptr<cmTargetLinkInterface> + ComputeLinkInterface(const char* config); cmTargetLinkInterfaceMap LinkInterface; // The cmMakefile instance that owns this target. This should |