Archived

This topic is now archived and is closed to further replies.

Greg K

delete []

Recommended Posts

When using delete, what possible errors could you get? I try to free some memory using delete and it gives me an assert error "Damage after Normal block #1641 : 00DFAAD0" (the wording may be a bit diff but the numbers are the same). The memory pointer is the correct pointer to the memory I am trying to free. I output the address to a file directly after allocation and then again just before I free it and it is the same pointer all three times (in the assert as well). Any suggestions? -Greg

Share this post


Link to post
Share on other sites
>>I output the address to a file directly after allocation and then again just before I free it and it is the same pointer all three times (in the assert as well).<<

drop some code so we can see.
by any chance do you free the memory in another function?

also what did you create it with? new? or malloc/calloc/realloc?
is the memory in question an array or single entity?
(ie. int *intPtr = new int[10] or int *intPtr = new int)

Share this post


Link to post
Share on other sites
@Alpha_ProgDes: Sorry, I thought I explained it well enough without showing code.

@Evil Bill: Thanks. That is what I am going to do now except I am just inputting it straight into an int and then typecasting it to a word.
-Greg

Share this post


Link to post
Share on other sites