Ensure UIView.layer is accessed on main thread.

BUG=webrtc:7829

Review-Url: https://codereview.webrtc.org/3002583002
Cr-Commit-Position: refs/heads/master@{#19345}
This commit is contained in:
andersc
2017-08-15 00:36:00 -07:00
committed by Commit Bot
parent 3439c89358
commit c288dab6e2

View File

@ -27,12 +27,15 @@
if (_captureSession == captureSession) { if (_captureSession == captureSession) {
return; return;
} }
[RTCDispatcher dispatchAsyncOnType:RTCDispatcherTypeMain
block:^{
_captureSession = captureSession; _captureSession = captureSession;
AVCaptureVideoPreviewLayer *previewLayer = [self previewLayer]; AVCaptureVideoPreviewLayer *previewLayer = [self previewLayer];
[RTCDispatcher dispatchAsyncOnType:RTCDispatcherTypeCaptureSession [RTCDispatcher dispatchAsyncOnType:RTCDispatcherTypeCaptureSession
block:^{ block:^{
previewLayer.session = captureSession; previewLayer.session = captureSession;
}]; }];
}];
} }
- (void)layoutSubviews { - (void)layoutSubviews {