Re: Error on deleting pointer
Re: Error on deleting pointer
- Subject: Re: Error on deleting pointer
- From: Jens Alfke <email@hidden>
- Date: Sat, 10 Sep 2011 13:23:02 -0700
On Sep 10, 2011, at 7:37 AM, Jos Timanta Tarigan wrote:
> GuardMalloc[FighterTD-23087]: guard malloc zone failure: freeing a pointer we didn't allocate that was not claimed by any registered zone
> GuardMalloc[FighterTD-23087]: Explicitly trapping into debugger!!!
>
> the error occurs when I try to delete a pointer (which is treated as an array).
It’s not a valid pointer, then. The message is simply telling you that the address passed to free() doesn’t correspond to any existing malloc()ed block. The pointer might be to an already-freed block, or the pointer value might be garbage. This is a typical kind of bug when writing C/C++ level code, nothing OS X specific at all.
Since you say you’re deleting an array, make sure you understand the difference between “delete x” and “delete [] x”, and check that you’re using the correct one.
—Jens _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden