* [iOS] support multi-context

Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/b8167eea
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/b8167eea
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/b8167eea

Branch: refs/heads/master
Commit: b8167eeab20c4ebfa4f5f981054dbb992a34758e
Parents: c504e35
Author: acton393 <[email protected]>
Authored: Tue Dec 12 14:58:51 2017 +0800
Committer: acton393 <[email protected]>
Committed: Wed Dec 20 17:52:04 2017 +0800

----------------------------------------------------------------------
 ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m | 2 ++
 ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m    | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b8167eea/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m 
b/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m
index 4b46bea..1bdf0bc 100644
--- a/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m
+++ b/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m
@@ -546,6 +546,8 @@ _Pragma("clang diagnostic pop") \
     }
     
     [self callJSMethod:@"destroyInstance" args:@[instance]];
+    WXSDKInstance *sdkIntance = [WXSDKManager instanceForID:instance];
+    sdkIntance.instanceJavaScriptContext = NULL;
 }
 
 - (void)forceGarbageCollection

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b8167eea/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m 
b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m
index 5be22d5..4476524 100644
--- a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m
+++ b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m
@@ -358,7 +358,7 @@ typedef enum : NSUInteger {
     } else {
         // Fallback
     }
-    [WXBridgeContext mountContextEnvironment:self.instanceJavaScriptContext];
+    [WXBridgeContext mountContextEnvironment:_instanceJavaScriptContext];
 }
 
 - (void)refreshInstance:(id)data

Reply via email to