fix: Close CameraSession
if the View is removed (#2174)
* fix: Close `CameraSession` if the View is removed * fix: Use ViewManager's `onDropViewInstance` instead * fix: Only stop repeating if we have a session * fix: Reset `configuration` on `close()`
This commit is contained in:
@@ -31,6 +31,11 @@ class CameraViewManager : ViewGroupManager<CameraView>() {
|
||||
|
||||
override fun getName(): String = TAG
|
||||
|
||||
override fun onDropViewInstance(view: CameraView) {
|
||||
view.destroy()
|
||||
super.onDropViewInstance(view)
|
||||
}
|
||||
|
||||
@ReactProp(name = "cameraId")
|
||||
fun setCameraId(view: CameraView, cameraId: String) {
|
||||
view.cameraId = cameraId
|
||||
|
Reference in New Issue
Block a user