Parameter Value Strings and CF retain/release issues
Parameter Value Strings and CF retain/release issues
- Subject: Parameter Value Strings and CF retain/release issues
- From: Brian Willoughby <email@hidden>
- Date: Sat, 2 Oct 2004 22:58:52 -0700
I have written an audio unit which has an Indexed Parameter, and I seem to be having problems with retain/release of the CoreFoundation objects. This all made much more sense to me in ObjC, so can anyone tell me what I'm doing wrong below? The AU works, but there is a Segmentation fault when running auval which says:
*** malloc[4623]: error for object 0xa5580: Incorrect checksum for freed object - object was probably modified after being freed; break at szone_error
Here is the code:
ComponentResult gain::GetParameterValueStrings( AudioUnitScope inScope,
AudioUnitParameterID inParameterID,
CFArrayRef * outStrings)
{
if ((inScope == kAudioUnitScope_Global) && (inParameterID == kParam_Gain))
{
if (outStrings == NULL)
return noErr; //called by GetPropInfo
CFStringRef strings[16];
for (int i = 0; i < 16; i++)
{
strings[i] = CFStringCreateWithFormat(NULL, NULL, CFSTR("%7.4g dB"), i * 6.02060L);
}
*outStrings = CFArrayCreate(NULL, (const void **)strings, 16, &kCFTypeArrayCallBacks);
return noErr;
}
return kAudioUnitErr_InvalidProperty;
}
_______________________________________________
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