At 4:44 PM +0200 23-04-00, Paul Nevai wrote:
>If I have
>
>MemHandle currentMemoRecH = DmQueryRecord (MemoDB, 0);
>Char * txtP = MemHandleLock (currentMemoRecH);
>DmDeleteRecord (MemoDB, 0);
>
>then s it necessary to do a
>
>MemPtrUnlock (txtP);

No.  DmDeleteRecord calls MemHandleFree, which works even if the handle is
locked.

However, good form says you should always unlock a handle you've locked.
At some point we might having the debug ROMs give you a warning if you try
to free a locked handle, because this is often a source of memory
management bugs.  (...when you later try to access the deleted/dangling
pointer.)

                                --Bob



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palm.com/devzone/mailinglists.html

Reply via email to