This is probably a very silly and simple question to most of you, but I have the following code creating a temporary array within a function, at the end of the function i need to release the memory. Here is the code:
double *FFTOut;
//FFT Out removes the alternative zeros added in the earler phase (before the FFT)
FFTOut = (double *)malloc((CFArray1Size)* sizeof(double));
So the pointer FFTOut is to a block of memory, I have tried the following...
[FFTOut release];
and...
[FFTO开发者_如何学运维ut dealloc];
Neither of which work. I'm sorry to post such a trivial question, but i can't seem to find the answer to this? Unless I am allocating the memory incorrectly in the first place, but I don't think this is the case?
Many Thanks
If you malloc, you have to use free().
release is for objective-c object that you've either new'd or alloc'd.
精彩评论