title: Using malloc/free in Objective-C object
body: <p>I have a class <code>AudioManager</code> with a member of type <code>AudioBufferList *</code>. (This is a struct declared in the <code>CoreAudio</code> framework). Since <code>AudioBufferList</code> is not a <code>NSObject</code>, I cannot retain it, so I have to alloc/free it (correct me if I'm wrong).</p>
  
  <p>My question is, where is the 'right' place to free it? Currently I am doing it in the <code>dealloc</code> method of <code>AudioManager</code>. If I understand correctly, this method is invoked automatically once the <code>release</code> message is sent to the instance of <code>AudioManager</code> --- is that true? Is there any other recommended practice regarding using alloc/free on non-objects members of Objective-C objects?</p>
  
  <p>Edit:</p>
  
  <p>From Apples documentation:</p>
  
  <blockquote>
    <p>Subclasses must implement their own
    versions of dealloc to allow the
    release of any additional memory
    consumed by the object—such as
    dynamically allocated storage for data
    or object instance variables owned by
    the deallocated object. After
    performing the class-specific
    deallocation, the subclass method
    should incorporate superclass versions
    of dealloc through a message to super:</p>
  </blockquote>
  
  <p>Which makes things a little bit clearer - but more insights are appreciated.</p>