From 0a2d7d685aaade093c2165c91432d90450997461 Mon Sep 17 00:00:00 2001 From: pandamicro Date: Thu, 13 Jul 2017 23:40:32 +0800 Subject: [PATCH] Fix action manager's memory leak --- cocos2d/actions/CCActionManager.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/cocos2d/actions/CCActionManager.js b/cocos2d/actions/CCActionManager.js index d9afe9b4d2..5268292657 100644 --- a/cocos2d/actions/CCActionManager.js +++ b/cocos2d/actions/CCActionManager.js @@ -29,15 +29,13 @@ * @constructor * @private */ -var HashElement = cc._Class.extend({ - ctor:function () { - this.actions = []; - this.target = null; //ccobject - this.actionIndex = 0; - this.currentAction = null; //CCAction - this.paused = false; - } -}); +var HashElement = function () { + this.actions = []; + this.target = null; //ccobject + this.actionIndex = 0; + this.currentAction = null; //CCAction + this.paused = false; +}; /** * !#en @@ -91,6 +89,7 @@ cc.ActionManager = cc._Class.extend(/** @lends cc.ActionManager# */{ element.actionIndex = 0; element.currentAction = null; element.paused = false; + element.target = null; this._elementPool.push(element); },