From acf03c06d5001afe0bee0401f68a05659a37ea69 Mon Sep 17 00:00:00 2001 From: pandamicro Date: Wed, 23 Dec 2015 23:28:14 +0800 Subject: [PATCH] Fixed WebSocket JSB crash issue --- cocos/scripting/js-bindings/manual/network/jsb_websocket.cpp | 2 +- tests/js-tests/src/EventTest/EventTest.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cocos/scripting/js-bindings/manual/network/jsb_websocket.cpp b/cocos/scripting/js-bindings/manual/network/jsb_websocket.cpp index 551eb0d499..a38d1dcea0 100644 --- a/cocos/scripting/js-bindings/manual/network/jsb_websocket.cpp +++ b/cocos/scripting/js-bindings/manual/network/jsb_websocket.cpp @@ -140,8 +140,8 @@ public: ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(_JSDelegate.ref()), "onclose", 1, &args); auto copy = &p->obj; - jsb_remove_proxy(p); JS::RemoveObjectRoot(cx, copy); + jsb_remove_proxy(p); CC_SAFE_DELETE(ws); } diff --git a/tests/js-tests/src/EventTest/EventTest.js b/tests/js-tests/src/EventTest/EventTest.js index 03d05f51b4..edaa70efcf 100644 --- a/tests/js-tests/src/EventTest/EventTest.js +++ b/tests/js-tests/src/EventTest/EventTest.js @@ -366,7 +366,7 @@ var MouseTest = EventTest.extend({ if( 'mouse' in cc.sys.capabilities ) { cc.eventManager.addListener({ - event: cc.EventListener.MOUSE, + event: cc.EventListener.MOUSE, onMouseDown: function(event){ var pos = event.getLocation(), target = event.getCurrentTarget(); if(event.getButton() === cc.EventMouse.BUTTON_RIGHT)