Merge pull request #10064 from pipu/fix_memory_leak

Fix memory leak
This commit is contained in:
minggo 2015-01-20 13:48:35 +08:00
commit bad526e8de
1 changed files with 2 additions and 4 deletions

View File

@ -150,8 +150,7 @@ std::string FlatBuffersSerialize::serializeFlatBuffersWithXMLFile(const std::str
return ".csd file doesn not exists ";
}
ssize_t size;
std::string content =(char*)FileUtils::getInstance()->getFileData(inFullpath, "r", &size);
std::string content = FileUtils::getInstance()->getStringFromFile(inFullpath);
// xml parse
tinyxml2::XMLDocument* document = new tinyxml2::XMLDocument();
@ -1124,8 +1123,7 @@ FlatBufferBuilder* FlatBuffersSerialize::createFlatBuffersWithXMLFileForSimulato
// CCLOG(".csd file doesn not exists ");
}
ssize_t size;
std::string content =(char*)FileUtils::getInstance()->getFileData(inFullpath, "r", &size);
std::string content = FileUtils::getInstance()->getStringFromFile(inFullpath);
// xml parse
tinyxml2::XMLDocument* document = new tinyxml2::XMLDocument();