Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Commit

Permalink
[iOS] Break retain cycle when set function of JSContext
Browse files Browse the repository at this point in the history
  • Loading branch information
zhongwuzw committed Sep 9, 2019
1 parent 6daad9e commit cbb8af1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m
Expand Up @@ -145,12 +145,12 @@ - (void)registerGlobalFunctions
}];

[_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];
});
}
Expand Down

0 comments on commit cbb8af1

Please sign in to comment.