Merge pull request #2816 from ehren:avcapturesession_leak

This commit is contained in:
Vadim Pisarevsky 2014-07-25 13:18:05 +00:00
commit 7cefaa49dd

View File

@ -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;