Przeglądaj źródła

1.扫描线程问题修复

huangxiaodong 1 tydzień temu
rodzic
commit
4bee65b121

+ 5 - 1
创维盒子/code/Class/Guide/QRCodeScanViewController.m

@@ -204,7 +204,11 @@ AVCaptureDeviceInput *input = [AVCaptureDeviceInput deviceInputWithDevice:device
 //    [self.photoBtn addTarget:self action:@selector(photoBtnClick:) forControlEvents:UIControlEventTouchUpInside];
 //    [self.view addSubview:self.photoBtn];
     //9.开始扫描
-    [self.session startRunning];
+    KWeakSelf
+    globalBlock(^{
+        [weakSelf.session startRunning];
+    });
+
     
     //添加返回键
     CGFloat btn_w_h  = 40;

+ 5 - 1
创维盒子/code/Class/Set/ChangeDevice/QRCodeScanForChangeDeviceViewController.m

@@ -220,7 +220,11 @@ AVCaptureDeviceInput *input = [AVCaptureDeviceInput deviceInputWithDevice:device
 //    [self.photoBtn addTarget:self action:@selector(photoBtnClick:) forControlEvents:UIControlEventTouchUpInside];
 //    [self.view addSubview:self.photoBtn];
     //9.开始扫描
-    [self.session startRunning];
+    KWeakSelf
+    globalBlock(^{
+        [weakSelf.session startRunning];
+    });
+
     
     //添加返回键
     CGFloat btn_w_h  = 40;

+ 5 - 1
创维盒子/code/mine/scanToPCLoginViewController.m

@@ -160,7 +160,11 @@ AVCaptureDeviceInput *input = [AVCaptureDeviceInput deviceInputWithDevice:device
     [self.session addOutput:guangOutPut];
 
     //9.开始扫描
-    [self.session startRunning];
+    KWeakSelf
+    globalBlock(^{
+        [weakSelf.session startRunning];
+    });
+
     
     //添加返回键
     CGFloat btn_w_h  = 40;