From 7cc38792578df1b49bece114ea73ca8812144d85 Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Wed, 11 Jun 2014 22:03:10 +0800 Subject: [PATCH] Ensuring release cache texture in timely. --- cocos/2d/CCLabel.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/cocos/2d/CCLabel.cpp b/cocos/2d/CCLabel.cpp index 39ef02f014..d01925bbd0 100644 --- a/cocos/2d/CCLabel.cpp +++ b/cocos/2d/CCLabel.cpp @@ -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) {