mirror of https://github.com/axmolengine/axmol.git
modiry document->Parse((char*)pByte); to document->Parse((const char*)pByte);
This commit is contained in:
parent
85fb2c91ab
commit
29779a4604
|
@ -736,11 +736,10 @@ ActionTimeline* ActionTimelineCache::loadAnimationActionWithFileFromXML(const st
|
|||
|
||||
//fix memory leak for v3.3
|
||||
unsigned char* pByte = FileUtils::getInstance()->getFileData(fullpath, "r", &size);;
|
||||
std::string content =(char*)pByte;
|
||||
|
||||
// xml parse
|
||||
tinyxml2::XMLDocument* document = new tinyxml2::XMLDocument();
|
||||
document->Parse(content.c_str());
|
||||
document->Parse((const char*)pByte);
|
||||
|
||||
free(pByte);
|
||||
|
||||
|
|
|
@ -1256,12 +1256,11 @@ Node* CSLoader::nodeFromXMLFile(const std::string &fileName)
|
|||
ssize_t size;
|
||||
|
||||
//fix memory leak for v3.3
|
||||
unsigned char* pByte = FileUtils::getInstance()->getFileData(fullpath, "r", &size);;
|
||||
std::string content =(char*)pByte
|
||||
unsigned char* pByte = FileUtils::getInstance()->getFileData(fullpath, "r", &size);
|
||||
|
||||
// xml parse
|
||||
tinyxml2::XMLDocument* document = new tinyxml2::XMLDocument();
|
||||
document->Parse(content.c_str());
|
||||
document->Parse((const char*)pByte);
|
||||
|
||||
free(pByte);
|
||||
|
||||
|
|
|
@ -773,7 +773,7 @@ int LuaStack::luaLoadChunksFromZIP(lua_State *L)
|
|||
(unsigned char*)stack->_xxteaKey,
|
||||
(xxtea_long)stack->_xxteaKeyLen,
|
||||
&len);
|
||||
delete []zipFileData;
|
||||
free(zipFileData);
|
||||
zipFileData = nullptr;
|
||||
zip = ZipFile::createWithBuffer(buffer, len);
|
||||
} else {
|
||||
|
@ -797,7 +797,7 @@ int LuaStack::luaLoadChunksFromZIP(lua_State *L)
|
|||
lua_setfield(L, -2, filename.c_str());
|
||||
++count;
|
||||
}
|
||||
delete []zbuffer;
|
||||
free(zbuffer);
|
||||
}
|
||||
filename = zip->getNextFilename();
|
||||
}
|
||||
|
@ -812,7 +812,7 @@ int LuaStack::luaLoadChunksFromZIP(lua_State *L)
|
|||
}
|
||||
|
||||
if (zipFileData) {
|
||||
delete []zipFileData;
|
||||
free(zipFileData);
|
||||
}
|
||||
|
||||
if (buffer) {
|
||||
|
|
|
@ -108,7 +108,7 @@ extern "C"
|
|||
{
|
||||
LuaStack* stack = LuaEngine::getInstance()->getLuaStack();
|
||||
stack->luaLoadBuffer(L, (char*)chunk, (int)chunkSize, chunkName.c_str());
|
||||
delete []chunk;
|
||||
free(chunk);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue