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
|
val currentOutputs = outputs
|
||||||
if (currentOutputs != null && currentOutputs.enableHdr != hdr) {
|
if (currentOutputs != null && currentOutputs.enableHdr != hdr) {
|
||||||
// Update existing HDR for Outputs
|
// Update existing HDR for Outputs
|
||||||
|
this.outputs?.close()
|
||||||
this.outputs = CameraOutputs(
|
this.outputs = CameraOutputs(
|
||||||
currentOutputs.cameraId,
|
currentOutputs.cameraId,
|
||||||
cameraManager,
|
cameraManager,
|
||||||
|
@ -98,6 +98,7 @@ class CameraOutputs(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun close() {
|
override fun close() {
|
||||||
|
previewOutput?.close()
|
||||||
photoOutput?.close()
|
photoOutput?.close()
|
||||||
videoOutput?.close()
|
videoOutput?.close()
|
||||||
codeScannerOutput?.close()
|
codeScannerOutput?.close()
|
||||||
|
Loading…
Reference in New Issue
Block a user