• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: AudioDriverExamples:NullAudio.c: retain on returned CFStringRef
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >AudioDriverExamples:NullAudio.c: retain on returned CFStringRef (From: Andrew White <email@hidden>)

  • Prev by Date: AudioDriverExamples:NullAudio.c: retain on returned CFStringRef
  • Next by Date: Re: Enabling volume balance control
  • Previous by thread: AudioDriverExamples:NullAudio.c: retain on returned CFStringRef
  • Next by thread: Re: AudioTimeStamp in AURenderCallback
  • Index(es):
    • Date
    • Thread