title: Every time i run this code it gives me error saying "(CMTime) presentationTime = <out of scope>" and same with imageBufferRef out of scope
body: <p>Running the following code</p>
  
  <pre><code>var sampleData  = NSMutableArray()
  
  for var i = sampleData.count-1 ; i &gt;= 0 ; i-- {
  
          let  presentationTime : CMTime = CMSampleBufferGetPresentationTimeStamp(sampleData[i] as! CMSampleBuffer)
  
          let imageBufferRef : CVPixelBufferRef = CMSampleBufferGetImageBuffer(sampleData[sampleData.count - i - 1] as! CMSampleBuffer)!
  
          while (!writerInput.readyForMoreMediaData) {
              NSThread.sleepForTimeInterval(0.1)
          }
  
          pixelBufferAdaptor.appendPixelBuffer(imageBufferRef, withPresentationTime: presentationTime)
   }
  </code></pre>
  
  <p>Yields the following error:</p>
  
  <pre><code>objc[1670]: _objc_rootFinalize called with garbage collection off
  
  Printing description of imageBufferRef:
  (CVPixelBufferRef) imageBufferRef = out of scope
  
  Printing description of presentationTime:
  (CMTime) presentationTime = out of scope
  </code></pre>