Ensure method which updates UI is called in main thread

Bug: None
Change-Id: I52d6871e7852e15ef8404377ed37ea894aedae5a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/216500
Commit-Queue: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33881}
This commit is contained in:
aidenluo 2021-04-30 10:41:31 +08:00 committed by WebRTC LUCI CQ
parent acfd71c662
commit 0365c99474
2 changed files with 6 additions and 1 deletions

View File

@ -80,6 +80,7 @@ Paul Kapustin <pkapustin@gmail.com>
Peng Yu <yupeng323@gmail.com>
Philipp Hancke <philipp.hancke@googlemail.com>
Piasy Xu <xz4215@gmail.com>
Qi Luo <aidenluo.me@gmail.com>
Rafael Lopez Diez <rafalopezdiez@gmail.com>
Ralph Giles <giles@ghostscript.com>
Raman Budny <budnyjj@gmail.com>

View File

@ -212,7 +212,11 @@ static int const kKbpsMultiplier = 1000;
return;
}
_state = state;
[_delegate appClient:self didChangeState:_state];
__weak ARDAppClient *weakSelf = self;
dispatch_async(dispatch_get_main_queue(), ^{
ARDAppClient *strongSelf = weakSelf;
[strongSelf.delegate appClient:strongSelf didChangeState:strongSelf.state];
});
}
- (void)connectToRoomWithId:(NSString *)roomId