fix: Close previous Outputs to free memory
This commit is contained in:
parent
10a44d5b79
commit
727fb39f01
@ -178,6 +178,7 @@ class CameraSession(
|
||||
val currentOutputs = outputs
|
||||
if (currentOutputs != null && currentOutputs.enableHdr != hdr) {
|
||||
// Update existing HDR for Outputs
|
||||
this.outputs?.close()
|
||||
this.outputs = CameraOutputs(
|
||||
currentOutputs.cameraId,
|
||||
cameraManager,
|
||||
|
@ -98,6 +98,7 @@ class CameraOutputs(
|
||||
}
|
||||
|
||||
override fun close() {
|
||||
previewOutput?.close()
|
||||
photoOutput?.close()
|
||||
videoOutput?.close()
|
||||
codeScannerOutput?.close()
|
||||
|
Loading…
Reference in New Issue
Block a user