Commit 7cefaa49 authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

Merge pull request #2816 from ehren:avcapturesession_leak

parents fc41e885 cd3aa018
...@@ -193,6 +193,14 @@ ...@@ -193,6 +193,14 @@
// 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;
self.captureVideoPreviewLayer = nil; self.captureVideoPreviewLayer = 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