imaginary-cloud / CameraManager

Simple Swift class to provide all the configurations you need to create custom camera view in your app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Deinit cause crash when `cameraDevice = .front`

TienVu-PW opened this issue · comments

Hi, seems like the self.cameraDevice = .back inside stopAndRemoveCaptureSession() in deinit is causing crash if the cameraDevice is .front, I have to manually calling stopAndRemoveCaptureSession() in my viewController to stop it before dismiss the viewController.

Please check this issue, thank you.

+1

I was able to work around this by setting cameraManager.shouldKeepViewAtOrientationChanges = true, since the issue is happening in the async closure at:

if let validEmbeddingView = self.embeddingView {

The specific runtime error is : Thread 1: EXC_BAD_ACCESS (code=1, address=0x20)

@TienVu-PW and @davinic,

we are currently looking at this issue. Thanks for the feedback 👍

@TienVu-PW @davinic @lucasmpaim,

this issue should be fixed in v4.2.3.
Please let me know if it worked.

@torrao Seems to be working fine now, thanks!