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
This commit is contained in:
parent
6a50a51b4e
commit
e9bc9c47c2
@ -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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user