Re: Weird CloseComponent Crash
Re: Weird CloseComponent Crash
- Subject: Re: Weird CloseComponent Crash
- From: Norman Franke <email@hidden>
- Date: Tue, 23 Jan 2007 14:52:43 -0800
Quoting William Stewart <email@hidden>:
On 23/01/2007, at 9:18 AM, Norman Franke wrote:
I randomly get a crash when calling CloseComponent on the HAL
output I opened with OpenAComponent. Often it happens the first
time I call it.
It dies in different places inside CloseComponent, but always in
szone_free. Up one level it can be things like
~BufferedAudioConverter's call to operator delete[], or
Resampler2Wrapper's call to ReleaseSincKernel.
My code is modeled after AudioFilePlayer in
/Developer/Examples/CoreAudio/PublicUtility/AudioFilePlayImpl. I'm
not using an AudioFile, however, just sending buffers of data to
CoreAudio much like it's doing in its thread.
I set the render callback to NULL (as in the sample),
This might be the problem.
Neither the callback or connection to an input in an AU is thread
safe - by design. If you are just manipulating these properties
while an AU is running or could be rendering, then there is a
critical region here where memory corruption can occur. This is why
the AUGraph API has the update call and handles the connection
semantics for you (we've added the same logic so you can instantiate
callbacks using the Graph as well in Leopard).
So, if you don't do this call, but just call the stop call - does
that make any difference?
I've removed that and we'll see how it goes, thanks. Someone may want
to update the sample code to not do this so people like me don't
emulate it. :)
-Norman
_______________________________________________
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