Skip to content

Commit

Permalink
Fix thread issue
Browse files Browse the repository at this point in the history
  • Loading branch information
MiloszFilimowski committed Jan 7, 2025
1 parent e44e876 commit cfdb717
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,7 @@ class CameraCapturer: VideoCapturer {
}

public func stopCapture() {
// TODO: FCE-1012
// capturer.stopCapture() causes a crash so this is a temporary fix
// There are two things that don't work
// 1. Weird WebRTC SDK implementation that uses AVCaptureConnection in RTCCameraVideoCapturer
// 2. Retain cycle that does't allow this object to ever be dealocated.
DispatchQueue.main.async {
self.captureSession.stopRunning()
}
self.captureSession.stopRunning()
}

public func switchCamera() {
Expand Down
4 changes: 3 additions & 1 deletion packages/react-native-client/ios/RNFishjamClientModule.swift
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ public class RNFishjamClientModule: Module {
}

AsyncFunction("leaveRoom") {
rnFishjamClient.leaveRoom()
DispatchQueue.main.async {
rnFishjamClient.leaveRoom()
}
}

AsyncFunction("startCamera") { (config: CameraConfig) in
Expand Down

0 comments on commit cfdb717

Please sign in to comment.