Fix resource leak with iOS camera due to failure to remove AVCaptureSession input/outputs on stop (Bug #3389)
This commit is contained in:
@@ -193,6 +193,14 @@
|
||||
// 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;
|
||||
self.captureVideoPreviewLayer = nil;
|
||||
|
Reference in New Issue
Block a user