Merge pull request #3683 from dumganhar/memory-leak-check

Fix a memory leak in Dictionary::createWithContentOfFile().
This commit is contained in:
James Chen 2013-09-17 23:07:30 -07:00
commit 42394d162d
1 changed files with 6 additions and 1 deletions

View File

@ -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)