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

Commit

Permalink
[iOS] Fix not proper use of block of WXPerformance.
Browse files Browse the repository at this point in the history
  • Loading branch information
wqyfavor committed May 15, 2019
1 parent d1b0e02 commit 9e0c832
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions ios/sdk/WeexSDK/Sources/Model/WXSDKInstance_performance.m
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,21 @@ - (void)onViewLoad:(WXComponent *)targetComponent
double modifyTime = CACurrentMediaTime()*1000;

__weak WXComponent* weakComponent = targetComponent;
__weak WXPerformance* weakSelf = self;

dispatch_async(dispatch_get_main_queue(), ^{
__strong WXComponent* strongComponent = weakComponent;
if (nil == strongComponent) {
__strong WXPerformance* strongSelf = weakSelf;

if (nil == strongComponent || nil == strongSelf) {
return;
}
if(![self _verifyComponent:strongComponent]){

if(![strongSelf _verifyComponent:strongComponent]){
return;
}
self.interactionAddCountRecord++;

[self _handleRenderTime:strongComponent withModifyTime:modifyTime];
strongSelf.interactionAddCountRecord++;
[strongSelf _handleRenderTime:strongComponent withModifyTime:modifyTime];
});
}

Expand Down

0 comments on commit 9e0c832

Please sign in to comment.