Re: AudioDriverExamples:NullAudio.c: retain on returned CFStringRef
Re: AudioDriverExamples:NullAudio.c: retain on returned CFStringRef
- Subject: Re: AudioDriverExamples:NullAudio.c: retain on returned CFStringRef
- From: Raveeshwara S <email@hidden>
- Date: Fri, 10 Apr 2015 12:52:37 +0530
Hi Andrew,
When we use a getter Core Foundation method, a retained object is returned and it is our responsibility to release it. My understanding is that similar semantics are followed here. We retain the box name before returning and it is the receiver's responsibility to release it.
Moving CFRetain inside lock might be more safe (to guard against CFRelease inside GDAudio_SetBoxPropertyData)
I'm just beginning with Core Audio. We could expect a better answer from more experienced.
Regards,
Raveeshwara S
> On 10-Apr-2015, at 11:26, Andrew White <email@hidden> wrote:
>
> In the AudioDriverExamples sample code, in NullAudio.c, in NullAudio_GetBoxPropertyData, when returning the box name via kAudioObjectPropertyName, we retain the CFStringRef returned.
>
> Why is this done? Is this not the responsibility of the receiver?
>
> And if it is to protect against us releasing our data, why is CFRetain called outside the lock?
>
> --
> Andrew White
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Coreaudio-api mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden