I am very new to basic foundation programming and would like to know what I think is right. I use ARC, and I'm not sure how it handles links not related to objects. I need to save the link to the selection buffer and use it later in the application. Is this possible, or will the sample buffer be freed before this?
Will use self.sampleBuffer = sampleBuffer_; cause a memory leak? Do I need to add a manual call to exit after this call?
@property (nonatomic)CMSampleBufferRef sampleBuffer; - (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer_ fromConnection:(AVCaptureConnection *)connection { //does this cause memory leak? self.sampleBuffer = sampleBuffer_; }
. , , , , - , assign , , (: own) .
assign
, , , , , , :
, CMSampleBuffer , , , ( ), , , .
, , , , CFRetain , (, CFRelease , ). strong Foundation.
CFRetain
CFRelease
strong