AVAssetWriterInput crash
I am recording a trailing buffer of video. At 15 second intervals, I am creating a new instance of AVAssetWriter
, and adding my instance of AVAssetWriterInput
as an input. I am grabbing frames using AVCaptureVideoDataOutput
, and adding them like this:
[writerInput appendSampleBuffer:sampleBuffer]
This works fine most of the time, but occasionally the app will crash with this error message:
*** -[CFDictionary removeObjectForKey:]: message sent to deallocated instance 0x96b28a0
What does this error message even mean? Might it mean that the AVAssetWriter
has been deallocated? Or does it mean that the AVAssetWriterInput
has been deal开发者_运维技巧located? Something else?
Thanks,
James
The message removeObjectForKey: was sent to an instance of CFDictionary (possibly an NSDictionary) with address 0x96b28a0. That instance had already been deallocated, but a pointer to it was still being used by the code.
If you were running with zombies enabled (aka NSZombiesEnabled), the system will track deallocated objects and keep references long enough to detect using dangling pointers.
Knowing that you are over-releasing an object is easier than finding the incorrect release. Plenty has been written on the subject.
精彩评论