Skip to content

Commit dcd7137

Browse files
committed
Capture the view controller weakly in QRScanner.start(...) callbacks
1 parent bd18ff5 commit dcd7137

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Authenticator/Source/TokenScannerViewController.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,10 @@ class TokenScannerViewController: UIViewController, QRScannerDelegate {
152152

153153
private func startScanning() {
154154
scanner.delegate = self
155-
scanner.start(success: { captureSession in
156-
self.videoLayer.session = captureSession
157-
}, failure: { error in
158-
self.dispatchAction(.scannerError(error))
155+
scanner.start(success: { [weak self] captureSession in
156+
self?.videoLayer.session = captureSession
157+
}, failure: { [weak self] error in
158+
self?.dispatchAction(.scannerError(error))
159159
})
160160
}
161161

0 commit comments

Comments
 (0)