Skip to content

Commit 386c9d3

Browse files
committed
Fix memory leak
1 parent 4b2f9c5 commit 386c9d3

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Sources/CodeScanner/ScannerViewController.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,8 @@ extension CodeScannerView {
457457
guard !isCapturing else { return }
458458
isCapturing = true
459459

460-
handler = { [self] image in
460+
handler = { [weak self] image in
461+
guard let self else { return }
461462
let result = ScanResult(string: stringValue, type: readableObject.type, image: image, corners: readableObject.corners)
462463

463464
switch parentView.scanMode {

0 commit comments

Comments
 (0)