Correct, but beware! Allocating only sizeof(Int32) bytes for the buffer evidently represents a misunderstanding: it happens to be enough to edit the value 89, but it won't be enough for a general Int32 value. The safe size to use is "maxStrIToALen". See Palm OS documentation on StrIToA.


At 01:49 PM 3/13/2003 +0100, Chris Apers wrote:


Need a MemHandleFree

MemPtrUnlock (str);
MemhandleFree(strH);


> Hi > Following is my code and it gives me Memory Leak. > > MemHandle strH; > Char * str; > Int32 num = 89; > > strH = MemHandleNew (sizeof (Int32)); > str = (Char *) MemHandleLock (strH); > > str = StrIToA (str, num); > > MemPtrUnlock (str); > > above code works but while stopping application > palm debug reports a Memory Leak




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

Reply via email to