Every piece of memory you allocate with MemPtrNew() must be freed with
MemPtrFree(). You can free memory anytime you like, but be careful of two
things, 1) only one call to MemPtrFree() for each call to MemPtrNew(), and
2) do not try to use allocated memory after you have freed it.

Something else to look for when you have memory new/free issues - be sure
you do not write past either end of the memory chunk. This will very likely
corrupt the allocation mechanism, causing problems when you try to free pr
allocate memory.

On 2/20/07, Durgesh Trivedi <[EMAIL PROTECTED]> wrote:
>
> Is it always necessary that the memory that we allocate to variable or
> string pointer (by MemPtrNew) only free when the application comletely exit
> not any where else in middle inthe program bcz when ever i try to free it
> any where else in the program in middle(by MemPtrFree) its start giving the
> error message freePointer
> But i think it is possible to do that but what i m doing wrong i don't
> understand
> so if any 1 give me suggestion regarding this will helpful to me
> --
> For information on using the PalmSource Developer Forums, or to
> unsubscribe, please see http://www.palmos.com/dev/support/forums/
>



-- 
CMRPigs
MRNotPigs
OSMR2Pigs
LILBMRPigs!
Jeff Loucks

-- 
For information on using the PalmSource Developer Forums, or to unsubscribe, 
please see http://www.palmos.com/dev/support/forums/

Reply via email to