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

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


The following commit(s) were added to refs/heads/master by this push:
     new 69cfe53  Double11 fix2 (#2937)
69cfe53 is described below

commit 69cfe53cd1886e827306c20f020bb66ecd19b361
Author: wqyfavor <[email protected]>
AuthorDate: Thu Sep 26 14:32:07 2019 +0800

    Double11 fix2 (#2937)
    
    * [iOS] Fix issue JS thread may be deallocated not in JS thread.
    
    * [iOS] Fix the issue that iOS13 logic not working if config center is not 
set.
---
 ios/sdk/WeexSDK/Sources/Bridge/WXJSCoreBridge.mm | 1 +
 ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m    | 4 ++++
 2 files changed, 5 insertions(+)

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);
diff --git a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m 
b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m
index 360ad4f..7a22748 100644
--- a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m
+++ b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m
@@ -606,6 +606,10 @@ typedef enum : NSUInteger {
         BOOL alwaysUseMRCForObjectToWeexCore = [[configCenter 
configForKey:@"iOS_weex_ext_config.alwaysUseMRC" defaultValue:@(NO) 
isDefault:NULL] boolValue];
         ConvertSwitches(isIOS13, useMRCForInvalidJSONObject, 
alwaysUseMRCForObjectToWeexCore);
     }
+    else {
+        BOOL isIOS13 = [[[UIDevice currentDevice] systemVersion] integerValue] 
== 13;
+        ConvertSwitches(isIOS13, YES, NO);
+    }
     return NO;
 }
 

Reply via email to