Skip to content

Commit

Permalink
fix strong reference cycle as outlined in #150
Browse files Browse the repository at this point in the history
  • Loading branch information
xmanu committed Aug 23, 2024
1 parent 34da57f commit b1b57e6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Sources/CodeScanner/ScannerViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit b1b57e6

Please sign in to comment.