hgwhittle
hgwhittle

Reputation: 9426

AUParameterTree dealloc causing deadlock

I'm experiencing a crash with the following stack trace in a background thread:

enter image description here

My app contains audio units that are allocated for a given set of audio files. When the given set of audio files changes, any current audio units are deallocated and new ones created for the new set. Intermittently, during the deallocation of the audio units, the crash above will occur. Seems that when the audio unit's AUParameterTree is deallocated, a deadlock occurs. Has anyone seen symptoms like this before? If so, what's causing the deadlock and how can it be prevented?

Upvotes: 1

Views: 77

Answers (1)

hotpaw2
hotpaw2

Reputation: 70693

Are your audio units or audio graph running or just recently stopped? If so, that could be part of the problem.

Because audio units runs in their own separate thread, and require time to drain, you may need to wait a period of time (maybe 1 or 2 seconds to be on the safe side?) before audio units or any of their resources can be safely deallocated.

Upvotes: 2

Related Questions