Skip to content

Commit

Permalink
Back out "Avoid accessing self.component on background thread"
Browse files Browse the repository at this point in the history
Summary: Changelog: [Internal] backout change dispatching main queue before using it

Reviewed By: shergin

Differential Revision: D25319046

fbshipit-source-id: 4f8952e577cfd9033fb2c2248b9b056a0d468b5d
  • Loading branch information
Kim Svatos authored and facebook-github-bot committed Dec 4, 2020
1 parent a326a30 commit 5d8fcde
Showing 1 changed file with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,18 +130,12 @@ - (void)unmountSurfaceView

- (void)surface:(RCTSurface *)surface didChangeIntrinsicSize:(CGSize)intrinsicSize
{
__weak const auto weakSelf = self;
dispatch_async(dispatch_get_main_queue(), ^{
[weakSelf setIntrinsicSize:intrinsicSize];
});
[self setIntrinsicSize:intrinsicSize];
}

- (void)surface:(RCTSurface *)surface didChangeStage:(RCTSurfaceStage)stage
{
__weak const auto weakSelf = self;
dispatch_async(dispatch_get_main_queue(), ^{
[weakSelf setStage:stage];
});
[self setStage:stage];
}

@end

0 comments on commit 5d8fcde

Please sign in to comment.