• 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: AU Properties and Ownership of CF objects
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AU Properties and Ownership of CF objects


  • Subject: Re: AU Properties and Ownership of CF objects
  • From: Mark <email@hidden>
  • Date: Thu, 24 Jan 2013 13:02:54 +1100

If you create a CF object using any of the provided CF function that contain the words 'create' or 'copy', you are returned a CF object with a retain count of one... you 'own' that object and must CFRelease it at some stage when you are done using the object.

Whether one assigns the CF object to a struct member or to a native-typed variable doesn't really enter into the equation... if you assign an 'owned' CF object to a struct member, you still 'own' the CF reference, and still have to deal with releasing the CF object when the struct containing the CF object is no longer needed.

HTH,

Mark




On 24/01/2013, at 3:51 AM, Stephen Blinkhorn wrote:

> Hello,
>
> Thanks to Technical Q&A 1684 I understand the ownership rules for AU properties that are Core Foundation data types (e.g. CFURLRef, CFStringRef etc). Basically, in an AU's GetProperty call you own the reference. But what if you have a CF data type embedded in a C style struct? This isn't really covered but presumably one cannot possibly own a CF reference in this case? Would just like to clarify that before I clean up some memory leaks.
>
> Thanks,
> Stephen
>
>
>
>
> _______________________________________________
> 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

Mark Hill
MachineCodex Software
http://www.machinecodex.com




 _______________________________________________
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

  • Follow-Ups:
    • Re: AU Properties and Ownership of CF objects
      • From: Stephen Blinkhorn <email@hidden>
    • Getting timing data and syncing things
      • From: HDS <email@hidden>
References: 
 >AU Properties and Ownership of CF objects (From: Stephen Blinkhorn <email@hidden>)

  • Prev by Date: Re: Need help getting started with CoreMidi
  • Next by Date: Getting timing data and syncing things
  • Previous by thread: AU Properties and Ownership of CF objects
  • Next by thread: Getting timing data and syncing things
  • Index(es):
    • Date
    • Thread