add std::nothrow

This commit is contained in:
jianglong0156 2015-07-08 15:19:17 +08:00
parent 7e26c381c6
commit d55c0c64c5
1 changed files with 2 additions and 2 deletions

View File

@ -375,7 +375,7 @@ bool FileUtils::writeToFile(ValueMap& dict, const std::string &fullPath)
bool FileUtils::writeValueMapToFile(ValueMap& dict, const std::string& fullPath)
{
tinyxml2::XMLDocument *doc = new tinyxml2::XMLDocument();
tinyxml2::XMLDocument *doc = new (std::nothrow)tinyxml2::XMLDocument();
if (nullptr == doc)
return false;
@ -415,7 +415,7 @@ bool FileUtils::writeValueMapToFile(ValueMap& dict, const std::string& fullPath)
bool FileUtils::writeValueVectorToFile(ValueVector vecData, const std::string& fullPath)
{
tinyxml2::XMLDocument *doc = new tinyxml2::XMLDocument();
tinyxml2::XMLDocument *doc = new (std::nothrow)tinyxml2::XMLDocument();
if (nullptr == doc)
return false;