mirror of https://github.com/axmolengine/axmol.git
Merge pull request #3683 from dumganhar/memory-leak-check
Fix a memory leak in Dictionary::createWithContentOfFile().
This commit is contained in:
commit
42394d162d
|
@ -389,7 +389,12 @@ void Dictionary::acceptVisitor(DataVisitor &visitor)
|
|||
|
||||
Dictionary* Dictionary::createWithContentsOfFile(const char *pFileName)
|
||||
{
|
||||
return createWithContentsOfFileThreadSafe(pFileName);
|
||||
auto ret = createWithContentsOfFileThreadSafe(pFileName);
|
||||
if (ret != nullptr)
|
||||
{
|
||||
ret->autorelease();
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool Dictionary::writeToFile(const char *fullPath)
|
||||
|
|
Loading…
Reference in New Issue