mirror of https://github.com/axmolengine/axmol.git
NewLabel memory leak fix.
This commit is contained in:
parent
77538c53e9
commit
2ee58c913c
|
@ -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);
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue