title: AVCaptureVideoPreviewLayer crash application on release
body: <p>I have problem with AVCaptureVideoPreviewLayer. I create it like that:</p>
  <pre><code>self.previewLayer = [AVCaptureVideoPreviewLayer layerWithSession:session];
  </code></pre>
  <p>session is my AVCaptureSession object. Its is initialized already. When I pop from view controller my app gets crash. I dont even use this vatiable and I get crash anyway. I get EXC_BAD_ACCESS code = 1;. self.previewLayer is my class object. I declarate is in my class, then make it property with retain and nonatomic and @synthesize. I use code from <a href="https://developer.apple.com/library/ios/samplecode/RosyWriter/Introduction/Intro.html" rel="nofollow noreferrer">RosyWritter</a> and only difference is that I use AVCaptureVideoPreviewLayer. It seems like I heve problem with release this object. Can anybody tell me what I do wrong?</p>
  <h1>edit</h1>
  <p>I finally resolved it. It occurs that I dont unregister videoOut delegate :)</p>
  <p>PS: I use automatic reference counting</p>