You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by mo...@apache.org on 2019/09/26 06:02:44 UTC

[incubator-weex] 01/01: [iOS] Fix issue JS thread may be deallocated not in JS thread.

This is an automated email from the ASF dual-hosted git repository.

moshen pushed a commit to branch double11-fix2
in repository https://gitbox.apache.org/repos/asf/incubator-weex.git

commit b11decf9226542a38e164b937a817732520af026
Author: qianyuan.wqy <qi...@taobao.com>
AuthorDate: Thu Sep 26 14:02:31 2019 +0800

    [iOS] Fix issue JS thread may be deallocated not in JS thread.
---
 ios/sdk/WeexSDK/Sources/Bridge/WXJSCoreBridge.mm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ios/sdk/WeexSDK/Sources/Bridge/WXJSCoreBridge.mm b/ios/sdk/WeexSDK/Sources/Bridge/WXJSCoreBridge.mm
index 9293fa5..9caff56 100644
--- a/ios/sdk/WeexSDK/Sources/Bridge/WXJSCoreBridge.mm
+++ b/ios/sdk/WeexSDK/Sources/Bridge/WXJSCoreBridge.mm
@@ -80,6 +80,7 @@
 {
     _jsContext.instanceId = nil;
     __block JSContext* theContext = _jsContext;
+    _jsContext = nil; // Make sure that the context MUST be freed in JS thread.
     WXPerformBlockOnBridgeThreadForInstance(^{
          theContext = nil; // release the context in js thread to avoid main-thread deadlock
     }, _weexInstanceId);