From a94e1f29a8382e8cef98b259227b96451c5ae84c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=90=E9=BE=99=E5=B1=B1=E4=BA=BA?= Date: Thu, 21 Jun 2018 14:52:14 +0800 Subject: [PATCH] fix label rendering issue (#2880) --- cocos2d/core/label/CCSGLabel.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/cocos2d/core/label/CCSGLabel.js b/cocos2d/core/label/CCSGLabel.js index acb90e6ad8..4637bf8bfc 100644 --- a/cocos2d/core/label/CCSGLabel.js +++ b/cocos2d/core/label/CCSGLabel.js @@ -142,6 +142,13 @@ _ccsg.Label = _ccsg.Node.extend({ _isUnderline: false, _fontAsset: null, + onExit: function () { + this._super(); + + this._renderCmd._texture.releaseTexture(); + this._notifyLabelSkinDirty(); + }, + //fontHandle it is a system font name, ttf file path or bmfont file path. ctor: function(string, fontAsset) { EventTarget.call(this); @@ -1270,13 +1277,11 @@ _ccsg.Label.pool = new JS.Pool(function (label) { label._fontHandle = ""; label._labelType = 0; label._resetBMFont(); - label._renderCmd._texture.releaseTexture(); if (CC_DEV) { cc.assert(!label._parent, 'Recycling label\'s parent should be null!'); } - label._updateLabel(); return true; -}, 120); +}, 10); _ccsg.Label.pool.get = function (string, fontAsset) { var label = this._get();