Ensuring release cache texture in timely.

This commit is contained in:
Dhilan007 2014-06-11 22:03:10 +08:00
parent 0ad57bdde7
commit 7cc3879257
1 changed files with 2 additions and 6 deletions

View File

@ -392,16 +392,12 @@ void Label::setFontAtlas(FontAtlas* atlas,bool distanceFieldEnabled /* = false *
if (_reusedLetter == nullptr)
{
_reusedLetter = Sprite::createWithTexture(_fontAtlas->getTexture(0));
_reusedLetter = Sprite::create();
_reusedLetter->setOpacityModifyRGB(_isOpacityModifyRGB);
_reusedLetter->retain();
_reusedLetter->setAnchorPoint(Vec2::ANCHOR_TOP_LEFT);
_reusedLetter->setBatchNode(this);
}
else
{
_reusedLetter->setTexture(_fontAtlas->getTexture(0));
}
_reusedLetter->setBatchNode(this);
if (_fontAtlas)
{