Danny, thanks for the reply. As I mentioned in another response, I am unable
to get this problem to happen for me, so static analysis is the only tool
available.

The original question still remains, though: what does the "free handle"
error really mean?

Ok, maybe I should just show you the code in question, especially since
something did occur to me: If I use FrmDoDialog to bring up a form with a
field on it, is it ok to access the data in the field (read-only, of course)
after the FrmDoDialog call but before the FrmDeleteForm call? I've assumed
that the field data remains intact until the latter call, but maybe the
system is allowed to free the data after the FrmDoDialog so that the
MemHandleLock or MemHandleUnlock call will throw the "free handle" error?

 FrmDoDialog(frmP);
 fldPtr = (FieldPtr)FrmGetObjectPtr(frmP, FrmGetObjectIndex(frmP,
RegScreenRegCodeField));
 fldTextH = FldGetTextHandle(fldPtr);
 if (fldTextH) {
    charPtr = (CharPtr)MemHandleLock(fldTextH);
   .
   .
   // Do something with charPtr (just examining it, not changing it)
   .
   .
    MemHandleUnlock(fldTextH);
 }
 FrmDeleteForm(frmP);

Any help or hints would be appreciated.

--Jim Preston


"Danny Epstein" <[EMAIL PROTECTED]> wrote in message
news:47437@palm-dev-forum...
>
> "James Preston" <[EMAIL PROTECTED]> wrote in message
> news:47394@palm-dev-forum...
> > Can someone give me a quick answer to what the memory manager error
"Free
> > Handle" means? Does it mean that I'm trying to call something like
> > MemHandleLock on a handle that I've already called MemHandleFree on?
>
> This error message is in PrvHandleCheck which is called from all the
> MemHandle* routines except MemHandleNew. So without a stack crawl, it's
hard
> to pinpoint.
> --
> Danny Epstein
> OS Engineer, Palm Inc.
>
>
>
>



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

Reply via email to