• 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
Bundles, CFStrings and release/retain
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bundles, CFStrings and release/retain


  • Subject: Bundles, CFStrings and release/retain
  • From: John Pitcairn <email@hidden>
  • Date: Wed, 20 Aug 2003 18:13:31 +1200

I'm using a lot of static CFStrings grabbed from a bundle .strings file, to allow the user to define parameter names, # of parameters, min/max/default values, and indexed values where needed. I'm using the sample code provided in SampleEffectUnit, with only slight modification/expansion to allow for more parameters.

There's a comment in the sample code:

// NOTE: Don't release the bundle. It is autoreleased.
sLocalized = true;
}
// !!MSH- check documentation to see whether we recommend releasing
string properties after they are returned from properties

and Bill Stewart wrote recently:

kAudioUnitProperty_ParameterValueName -> AudioUnitParameterValueName
typedef struct AudioUnitParameterValueName {
AudioUnitParameterID inParamID;
Float32 *inValue;
CFStringRef outName;
} AudioUnitParameterValueName;
Get
- should be released by caller
(So, if AU has static CFStrings for these, it should call CFRetain
on these names before returning them)

So - I guess my AU should be doing something in respect to releasing/retaining stuff, yes? What happens if I don't? And do I have to worry about just the CFStrings I actually supply to the host, or all the CFStrings I load for my own purposes that the host never sees? I'm really hazy on the whole memory-management issue - is there an AU example somewhere that demonstrates this in a reasonably idiot-friendly way?


--
John Pitcairn

--------------------------------------------------------------------------
Revolver Design | Opus Locus | Auckland, New Zealand
http://www.revolver.co.nz/forsale.phtml - updated 8 August 2003
--------------------------------------------------------------------------
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Bundles, CFStrings and release/retain
      • From: Marc Poirier <email@hidden>
  • Prev by Date: Re: AU&Logic:Notify Parameter change to Logic Control
  • Next by Date: Re: GetParameterValueStrings
  • Previous by thread: Apple Loops SDK Now Available!
  • Next by thread: Re: Bundles, CFStrings and release/retain
  • Index(es):
    • Date
    • Thread