title: how do I release a struct from memory and arrays within them
body: <p>I want to know how I can release a struct properly from memory and completely wipe it. I also need to wipe arrays or values within this struct. I tried just overwriting the struct with new data everytime the data changed but I observed a steady rise in memory use until I get a memory warning so I think my safest bet is to completely wipe the data first and then write to it again. </p>
  
  <pre><code>    typedef struct {
  
  
          SInt16  *array1;     
          SInt16  *array2;    
  
      } myStruct, *myStructPtr;
  
  
   myStructArray        myStruct[16];
  
      for(int i=0;i&lt;16;i++)
  
      {
          myStruct[i].array1 =
          (AudioUnitSampleType *) calloc (asize, sizeof (SInt16));
  
          myStruct[i].array2 =
          (AudioUnitSampleType *) calloc (asize, sizeof (SInt16));
  
      }
  
     free(myStructArray) // throws SIGBART error
  </code></pre>