RVRoadie wrote:
> I released a program with MemPtrUnlock instead of MemHandleUnlock. It worked
> fine, so I didn't catch it. Is it a problem?
>
> newUnpackRecH = DmNewHandle(AddrDB, AddrRecPackedSize(&addrRec));
> newUnpackRecP = (PrvAddrPackedDBRecord *) MemHandleLock(newUnpackRecH);
> <deleted>
> err = DmAttachRecord(AddrDB, &recNum, newUnpackRecH, &unpackRecH);
> MemPtrUnlock(newUnpackRecP); <--- should have been:
> MemHandleUnlock(newUnpackRecH);
> MemHandleFree(unpackRecH);
MemPtrUnlock (newUnpackRecP) and MemHandleUnlock (newUnpackRecH)
do the same thing since newUnpackRecP is the result of a
MemHandleLock (newUnpackRecH).
If you wanted to, you could even do this:
MemHandleUnlock (MemRecoverHandle (newUnpackRecP));
It should be the same thing as doing MemPtrUnlock().
In other words, there is nothing wrong with the original code
with MemPtrUnlock() in it.
- Logan
--
For information on using the Palm Developer Forums, or to unsubscribe, please
see http://www.palmos.com/dev/support/forums/