mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-20 23:52:40 +08:00
correct "fastSet" wrong usage in "writeStringToFile" (#1462)
* correct crash due to double free same address * do Data free only if malloc * Revert "do Data free only if malloc" This reverts commit 1586793adea4e4da240e37a5d2237d16bc5eadd4.
This commit is contained in:
@@ -574,7 +574,7 @@ FileUtils::~FileUtils()
|
||||
bool FileUtils::writeStringToFile(const std::string& dataStr, const std::string& fullPath)
|
||||
{
|
||||
Data data;
|
||||
data.fastSet((unsigned char*)dataStr.c_str(), dataStr.size());
|
||||
data.copy((unsigned char*)dataStr.c_str(), dataStr.size());
|
||||
|
||||
bool rv = writeDataToFile(data, fullPath);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user