I have a memory grow on a pointer, which i see in xcode instruments-allocations(iphone)
i have this : (audio buffer callback function that is perform many times a second )
int16_t *q = (int16_t *)(&bufferList)->mBuffers[0].mData;
int16_t average ;
for(int i=0; i < inNumberFrames; i++)
{
average=q[i]; //comment this solve all.
If i comment the last line, it becomes ok. thats it. and obviously q[i] is a problem.
i cant figure out, what am i doing wrong with this line .
I don’t see any specific issue that can cause memory growth in the snippet you posted:
So there is no way that any of the code in your question could cause a leak. Probably something is missing here.
Instruments should tell you which
mallocornewcaused the allocation that is leaking every time.