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/10/04 01:15:48 UTC
[incubator-weex] branch master updated: [iOS] Break retain cycle
when set function of JSContext
This is an automated email from the ASF dual-hosted git repository.
moshen 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 cbb8af1 [iOS] Break retain cycle when set function of JSContext
new 6be3e96 Merge pull request #2891 from zhongwuzw/break_jsContext_retain_cycle
cbb8af1 is described below
commit cbb8af1a41520a4fbbc763c62f535e1cc89ca9ac
Author: zhongwuzw <zh...@qq.com>
AuthorDate: Mon Sep 9 20:29:44 2019 +0800
[iOS] Break retain cycle when set function of JSContext
---
ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m b/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m
index 89287e5..8c00fa3 100644
--- a/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m
+++ b/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m
@@ -145,12 +145,12 @@ _Pragma("clang diagnostic pop") \
}];
[_jsBridge registerCallUpdateComponentData:^NSInteger(NSString *instanceId, NSString *componentId, NSString *jsonData) {
- if (_dataRenderHandler) {
+ if (weakSelf.dataRenderHandler) {
WXPerformBlockOnComponentThread(^{
long start = [WXUtility getUnixFixTimeMillis];
WXSDKInstance *instance = [WXSDKManager instanceForID:instanceId];
[instance.apmInstance addUpdateComponentDataTimestamp:start];
- [_dataRenderHandler callUpdateComponentData:instanceId componentId:componentId jsonData:jsonData];
+ [weakSelf.dataRenderHandler callUpdateComponentData:instanceId componentId:componentId jsonData:jsonData];
[instance.apmInstance addUpdateComponentDataTime:[WXUtility getUnixFixTimeMillis] - start];
});
}