fix(barcode-scanner): fix the cameraView is not removed after scanning in iOS (#2440)

Co-authored-by: Fabian-Lars <github@fabianlars.de>
This commit is contained in:
Kingsword
2025-11-17 05:31:30 +08:00
committed by GitHub
parent b4348cee92
commit 631d0e256a
2 changed files with 7 additions and 0 deletions
@@ -0,0 +1,6 @@
---
"barcode-scanner": patch
"barcode-scanner-js": patch
---
Fix the `cameraView` is not removed after scanning in iOS.
@@ -191,6 +191,7 @@ class BarcodeScannerPlugin: Plugin, AVCaptureMetadataOutputObjectsDelegate {
if self.captureSession != nil {
self.captureSession!.stopRunning()
self.cameraView.removePreviewLayer()
self.cameraView.removeFromSuperview()
self.captureVideoPreviewLayer = nil
self.metaOutput = nil
self.captureSession = nil