From e940eb948a34b21238e50a6c1168835508879377 Mon Sep 17 00:00:00 2001 From: pandamicro Date: Fri, 18 Aug 2017 16:25:50 +0800 Subject: [PATCH] Fix JSB_EditboxDelegate crash if js delegate has already been garbage collected --- cocos2d/core/components/CCEditBox.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cocos2d/core/components/CCEditBox.js b/cocos2d/core/components/CCEditBox.js index 82e8896670..65f9b779de 100644 --- a/cocos2d/core/components/CCEditBox.js +++ b/cocos2d/core/components/CCEditBox.js @@ -518,6 +518,11 @@ var EditBox = cc.Class({ this.node.emit('editing-return', this); }, + onDestroy: function () { + this._sgNode.setDelegate(null); + this._super(); + }, + __preload: function() { this._super();