On Wed, Nov 29, 2006 at 04:10:34PM -0500, P. Douglas Reeder wrote:
> 
> On Nov 29, 2006, at 3:31 PM, Reynaldo H. Verdejo Pinochet wrote:
> 
> >
> >Im confused by the whole handle issue, iirc if I call MemHandleNew
> >I should latter call MemHandleFree when im not going to need that
> >movable chunk anymore. is this correct?
> 
> Yes, unless some function takes control of the memory chunk (see the 
> docs for each).  Contrapositively, some functions will allocate a 
> memory chunk and return it to you, and you must deallocate the chunk 
> when you're done.   You have to read the docs for each function.  
> That's life when programming in C.

As Im not too accuantied with palm developing thats the way i often
do things, i mean, by carefully checking each function documentation,
problem is in this case the answer is not there. Id have really liked
to read something like this there, where it should be, in the API
documentation. Something like:

'This functions returns a handle that can be locked/unlocked but
NEVER freed'


> 
> DmNewRecord allocates memory in the storage heap, not the dynamic heap, 
> so you never call MemHandleFree for such chunks.

Will keep that in mind, thanks ;)

on the other issue? how do you know when to use MemHandleUnlock /
MemPtrUnlock ?


Best regards an thanks

        Reynaldo

> 
> >
> Doug Reeder
> Cognitive & Systematic Musicology Lab
> OSU School of Music
> 
> 
> -- 
> For information on using the PalmSource Developer Forums, or to 
> unsubscribe, please see http://www.palmos.com/dev/support/forums/

Attachment: signature.asc
Description: Digital signature

Reply via email to