If you allocated a handle or pointer memory space, you almost always have to
unallocated too.  There are few exceptions.  However, you can mix up the
deallocation method.  If you allocated handle space, you could deallocated
using a pointer if you already have the handle locked (thus saving the step
of unlocking it first).  Just remember any variable using the original
handle will point to an invalid memory location.

----- Original Message ----- 
From: "Pit" <[EMAIL PROTECTED]>
Newsgroups: palm-dev-forum
To: "Palm Developer Forum" <[EMAIL PROTECTED]>
Sent: Friday, April 23, 2004 6:54 AM
Subject: Re: MemPtrNew / MemPtrFree question


> Hi,
> does this also apply the the same way to MemHandles?
>
> Thanks
> Peter
>
> "Hays, Jonathan (GE Infrastructure)" <[EMAIL PROTECTED]> schrieb im
> Newsbeitrag news:[EMAIL PROTECTED]
> You need to free it the same way, and no, there is no built in garbage
> collector.
>
> -Jon
>
> --------------------------------------------
> Jonathan Hays
> Palm OS Certified Developer
> http://hazelware.luggle.com
> --------------------------------------------
>
>
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf Of Pit
> Sent: Thursday, April 22, 2004 1:32 PM
> To: Palm Developer Forum
> Subject: MemPtrNew / MemPtrFree question
>
>
> Hi,
> i m using MemPtrNew like in the following pseudo code:
>
> char** temp;
> temp = MemPtrNew (size * sizeof (char*))
> for ( int i = 0; i < size; i++)
> {
>     temp[i] = MemPtrNew (10);
> }
>
> Do i have to free it like the same way, or is a call of MemPtrFree(temp)
> enough?
> So does MemPtrFree(temp), also free the memory of temp[i]?
>
> Another question;
> Have i to call MemPtrFree each time i use MemPtrNew, or is there some sort
> of garbage collector, who free the memory never in use.
>
> Special Thanks
>
> Peter
>
>
>
> -- 
> For information on using the Palm Developer Forums, or to unsubscribe,
> please see http://www.palmos.com/dev/support/forums/
>
>
>
> -- 
> For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/
>



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

Reply via email to