my code are as following:
[session startRunning];
avLayer = [AVCaptureVideoPreviewLayer layerWithSession:session];
avLayer.frame = CGRectMake(0, 0, 320 , 416);
[self.view.layer addSublayer: avLayer];
avLayer.videoGravity = AVLayerVideoGravityResizeAspectFill;
every time I start run session, I need to add AVCaptureVideoPreviewLayer to my view.
My question is: does it need to realease AVCaptureVideoPreviewLayer before I add the new one?
If you create the memory for the objects,you need to release the memory for those objects.Here you didn’t allocated memory.So no need to release it.