From 02726d47f781d4568ea2a6a9478d7348d4bc3565 Mon Sep 17 00:00:00 2001 From: Vahid Hasani Date: Tue, 10 Oct 2023 20:31:54 +0330 Subject: [PATCH] fix: Close `CameraSession` in `onDetachedFromWindow()` (#1962) * Close camera session in onDetachedFromWindow * Remove cache folder --------- Co-authored-by: Marc Rousavy --- package/android/src/main/java/com/mrousavy/camera/CameraView.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/package/android/src/main/java/com/mrousavy/camera/CameraView.kt b/package/android/src/main/java/com/mrousavy/camera/CameraView.kt index 6cafe69..dae81a8 100644 --- a/package/android/src/main/java/com/mrousavy/camera/CameraView.kt +++ b/package/android/src/main/java/com/mrousavy/camera/CameraView.kt @@ -125,6 +125,7 @@ class CameraView(context: Context) : override fun onDetachedFromWindow() { super.onDetachedFromWindow() + cameraSession.close() launch { updateLifecycle() } }