title: QTCaptureDevice Closing By itself (FaceTime Camera) Mac
body: <p>I have a mac app that writes camera data to a file then uploads that file on an [NSTimer] to a server. However, after the camera runs for a while it closes itself and I see this in the log: <em>*</em> QTCaptureDeviceInput warning: The device "FaceTime HD Camera (Built-in)" was closed while still being used in a capture session. Make sure that the session is not running before closing any devices it is using.</p>
  
  <p>No other apps are open that can use the camera in the test case and the object for the device is not being released by me. I have gone so far as to call retain on it to prevent this, to no avail. </p>
  
  <p>I looked at Apple's docs and nowhere that I found did it talk about the camera being shut off by the system, so what could be causing this. In the meantime I have some code that periodically checks if it is open and if it isn't calls open on it.</p>
  
  <p>One thing I forgot I am using this notification and it is being fired: QTCaptureDeviceWasDisconnectedNotification</p>