Commit e9bc9c47 authored by Ehren Metcalfe's avatar Ehren Metcalfe Committed by Dikay900

Fix resource leak with iOS camera due to failure to remove AVCaptureSession…

Fix resource leak with iOS camera due to failure to remove AVCaptureSession input/outputs on stop (Bug #3389)

Conflicts:
	modules/highgui/src/cap_ios_abstract_camera.mm
parent 6a50a51b
...@@ -193,6 +193,13 @@ ...@@ -193,6 +193,13 @@
// Release any retained subviews of the main view. // Release any retained subviews of the main view.
// e.g. self.myOutlet = nil; // 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 stopRunning];
self.captureSession = nil; self.captureSession = nil;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment