NewLabel memory leak fix.

This commit is contained in:
James Chen 2014-01-26 20:53:55 +08:00
parent 77538c53e9
commit 2ee58c913c
2 changed files with 4 additions and 2 deletions

View File

@ -99,7 +99,7 @@ const char * Font::getCurrentGlyphCollection() const
}
}
unsigned short int * Font::getUTF16Text(const char *text, int &outNumLetters) const
unsigned short* Font::getUTF16Text(const char *text, int &outNumLetters) const
{
unsigned short* utf16String = cc_utf8_to_utf16(text);

View File

@ -136,7 +136,9 @@ FontAtlas * FontFreeType::createFontAtlas()
FontAtlas *atlas = new FontAtlas(*this);
if (_usedGlyphs != GlyphCollection::DYNAMIC)
{
atlas->prepareLetterDefinitions(cc_utf8_to_utf16(getCurrentGlyphCollection()));
unsigned short* utf16 = cc_utf8_to_utf16(getCurrentGlyphCollection());
atlas->prepareLetterDefinitions(utf16);
CC_SAFE_DELETE_ARRAY(utf16);
}
this->release();
return atlas;