Fix action manager's memory leak

This commit is contained in:
pandamicro
2017-07-13 23:40:32 +08:00
parent 0779e5a3c6
commit 0a2d7d685a
+8 -9
View File
@@ -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);
},