diff --git a/cocos2d/core/CCNode.js b/cocos2d/core/CCNode.js index 2ae8666595..f96808d5b4 100644 --- a/cocos2d/core/CCNode.js +++ b/cocos2d/core/CCNode.js @@ -974,7 +974,6 @@ var Node = cc.Class({ } if (CC_JSB) { - this._releaseAllActions(); if (this._touchListener) { this._touchListener.release(); this._touchListener.owner = null; diff --git a/cocos2d/core/label/CCSGLabelCanvasRenderCmd.js b/cocos2d/core/label/CCSGLabelCanvasRenderCmd.js index a83d2427c9..184ccb5ffc 100644 --- a/cocos2d/core/label/CCSGLabelCanvasRenderCmd.js +++ b/cocos2d/core/label/CCSGLabelCanvasRenderCmd.js @@ -375,7 +375,6 @@ this._calculateTextBaseline(); this._updateTexture(); - }; @@ -449,6 +448,8 @@ } this._texture._textureLoaded = false; + // Hack. because we delete _htmlElementObj after usage in WEBGL mode + this._texture._htmlElementObj = this._labelCanvas; this._texture.handleLoadedTexture(true); }; diff --git a/cocos2d/core/textures/CCTexture2D.js b/cocos2d/core/textures/CCTexture2D.js index 2722ad1823..4d2563da64 100644 --- a/cocos2d/core/textures/CCTexture2D.js +++ b/cocos2d/core/textures/CCTexture2D.js @@ -838,9 +838,10 @@ game.once(game.EVENT_RENDERER_INITED, function () { if (!game._rendererInitialized) return; if (!self._htmlElementObj) { - var img = cc.loader.getRes(self.url); - if (!img) return; - self.initWithElement(img); + var tex = cc.loader.getRes(self.url); + if (!tex || !tex._htmlElementObj) + return; + self.initWithElement(tex._htmlElementObj); } if (!self._htmlElementObj.width || !self._htmlElementObj.height) return; @@ -884,6 +885,8 @@ game.once(game.EVENT_RENDERER_INITED, function () { self.setAliasTexParameters(); } + self._htmlElementObj = null; + //dispatch load event to listener. self.emit("load"); },