Browse Source

Fix disposing camera from memory

flutter-beta
Paweł Kuźniak 6 years ago
committed by Dominik Spicher
parent
commit
243188bd9e
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      ios/Classes/QRView.swift

+ 2
- 2
ios/Classes/QRView.swift View File

@@ -23,11 +23,11 @@ public class QRView:NSObject,FlutterPlatformView {
func isCameraAvailable(success: Bool) -> Void {
if success {
do {
try scanner?.startScanning(resultBlock: { codes in
try scanner?.startScanning(resultBlock: { [weak self] codes in
if let codes = codes {
for code in codes {
guard let stringValue = code.stringValue else { continue }
self.channel.invokeMethod("onRecognizeQR", arguments: stringValue)
self?.channel.invokeMethod("onRecognizeQR", arguments: stringValue)
}
}
})


Loading…
Cancel
Save