File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
wire-ios/Wire-iOS/Sources/UserInterface/Camera Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -46,8 +46,13 @@ final class CameraController {
4646 init ? ( camera: SettingsCamera ) {
4747 guard !UIDevice. isSimulator else { return nil }
4848 self . currentCamera = camera
49- setupSession ( )
5049 self . previewLayer = AVCaptureVideoPreviewLayer ( session: session)
50+
51+ // `setupSession()` performs session configuration on a dedicated serial queue. This needs to happen after the
52+ // `previewLayer` is created to avoid simultaneous session configuration across different threads as
53+ // `AVCaptureVideoPreviewLayer` appears to configure the session internally on the main thread during init.
54+ // Configuring the `AVCaptureSession` from multiple threads can lead to a deadlock.
55+ setupSession ( )
5156 }
5257
5358 // MARK: - Session Management
You can’t perform that action at this time.
0 commit comments