From f700ddf45127db78525266f7df763083864941a2 Mon Sep 17 00:00:00 2001 From: pandamicro Date: Tue, 15 Mar 2016 21:46:55 +0800 Subject: [PATCH] Avoid JSB issue with new memory model (double remove listener) --- cocos2d/core/CCNode.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cocos2d/core/CCNode.js b/cocos2d/core/CCNode.js index daf642ddbe..18b1de4e4c 100644 --- a/cocos2d/core/CCNode.js +++ b/cocos2d/core/CCNode.js @@ -1045,7 +1045,7 @@ var Node = cc.Class({ }, _checkTouchListeners: function () { - if (this._bubblingListeners && this._touchListener) { + if (!(this._objFlags & Destroying) && this._bubblingListeners && this._touchListener) { for (var i = 0; i < _touchEvents.length; ++i) { if (this._bubblingListeners.has(_touchEvents[i])) { return; @@ -1057,7 +1057,7 @@ var Node = cc.Class({ } }, _checkMouseListeners: function () { - if (this._bubblingListeners && this._mouseListener) { + if (!(this._objFlags & Destroying) && this._bubblingListeners && this._mouseListener) { for (var i = 0; i < _mouseEvents.length; ++i) { if (this._bubblingListeners.has(_mouseEvents[i])) { return;