I am working on an app that manipulates HD photos. I am taking a photo with an AVCaptureSession, stopping it and then apply effects on that photo.
The thing that mak
I have encounter the same problem I have found this line is the main problem
[self.vImagePreview.layer addSublayer:captureVideoPreviewLayer];
Just remove the previewlayer from the super layer while deallocating and there is no memory issue. My deallocating function is as follow
-(void)deallocSession
{
[captureVideoPreviewLayer removeFromSuperlayer];
for(AVCaptureInput *input1 in session.inputs) {
[session removeInput:input1];
}
for(AVCaptureOutput *output1 in session.outputs) {
[session removeOutput:output1];
}
[session stopRunning];
session=nil;
outputSettings=nil;
device=nil;
input=nil;
captureVideoPreviewLayer=nil;
stillImageOutput=nil;
self.vImagePreview=nil;
}
i called this function before popping and pushing any other view. It solved my issue.