diff --git a/Sources/CodeScanner/ScannerViewController.swift b/Sources/CodeScanner/ScannerViewController.swift index 87930cb..8241115 100644 --- a/Sources/CodeScanner/ScannerViewController.swift +++ b/Sources/CodeScanner/ScannerViewController.swift @@ -448,7 +448,8 @@ extension CodeScannerView.ScannerViewController: AVCaptureMetadataOutputObjectsD return } - handler = { [self] image in + handler = { [weak self] image in + guard let self else { return } let result = ScanResult(string: stringValue, type: readableObject.type, image: image, corners: readableObject.corners) switch parentView.scanMode {