From 979ffb587a0224ad23ef1ea82ccb7932ae760673 Mon Sep 17 00:00:00 2001 From: pandamicro Date: Wed, 28 Feb 2018 16:48:37 +0800 Subject: [PATCH] Fix purgeDirector leak --- cocos2d/core/CCDirector.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cocos2d/core/CCDirector.js b/cocos2d/core/CCDirector.js index 6445382861..170a16cdec 100644 --- a/cocos2d/core/CCDirector.js +++ b/cocos2d/core/CCDirector.js @@ -412,7 +412,12 @@ cc.Director.prototype = { cc.renderer.clear(); - this._scene = null; + if (!CC_EDITOR) { + if (cc.isValid(this._scene)) { + this._scene.destroy(); + } + this._scene = null; + } this.stopAnimation();