Merge pull request #2420 from minggo/2073-userdefault_memory_leak_

fixed #2073: fix memory leak in CCUserDefault
This commit is contained in:
minggo 2013-04-22 01:46:00 -07:00
commit ec43617469
3 changed files with 3 additions and 0 deletions

View File

@ -66,6 +66,7 @@ static tinyxml2::XMLElement* getXMLNodeForKey(const char* pKey, tinyxml2::XMLEle
break;
}
xmlDoc->Parse(pXmlBuffer);
delete[] pXmlBuffer;
// get root node
*rootNode = xmlDoc->RootElement();
if (NULL == *rootNode)

View File

@ -81,6 +81,7 @@ static tinyxml2::XMLElement* getXMLNodeForKey(const char* pKey, tinyxml2::XMLDoc
break;
}
xmlDoc->Parse(pXmlBuffer);
delete[] pXmlBuffer;
// get root node
rootNode = xmlDoc->RootElement();
if (NULL == rootNode)

View File

@ -82,6 +82,7 @@ static tinyxml2::XMLElement* getXMLNodeForKey(const char* pKey, tinyxml2::XMLDoc
break;
}
xmlDoc->Parse(pXmlBuffer);
delete[] pXmlBuffer;
// get root node
rootNode = xmlDoc->RootElement();
if (NULL == rootNode)