Fix resource leak with iOS camera due to failure to remove AVCaptureSession input...
authorEhren Metcalfe <ehren.m@gmail.com>
Sat, 31 May 2014 23:41:16 +0000 (19:41 -0400)
committerDikay900 <dark900@xyz.de>
Sat, 23 May 2015 15:36:42 +0000 (17:36 +0200)
Conflicts:
modules/highgui/src/cap_ios_abstract_camera.mm

modules/videoio/src/cap_ios_abstract_camera.mm

index 1ded46a..565807c 100644 (file)
 
     // Release any retained subviews of the main view.
     // e.g. self.myOutlet = nil;
+    for (AVCaptureInput *input in self.captureSession.inputs) {
+        [self.captureSession removeInput:input];
+    }
+
+    for (AVCaptureOutput *output in self.captureSession.outputs) {
+        [self.captureSession removeOutput:output];
+    }
 
     [self.captureSession stopRunning];
     self.captureSession = nil;