I'm not 100% certain about this, but this is my guess.
I think your leak is because you're setting the field text handle to
Null, but not actually freeing the old text handles.
You've got 2 choices either free the handles, or set them back to what
they were, so that the OS knows to free them when it's done. You've
actually commented out FldSetTextHandle in one area, so you were on the
right lines at one point?
<snip>
if(txtNameH) {
err = MemHandleUnlock(txtNameH);
ErrFatalDisplayIf(err, "Could not Unlock chunk in name
field.");
// EITHER ADD THIS NEXT LINE
MemHandleFree(txtNameH);
// OR THIS NEXT LINE
FldSetTextHandle(usrNameFld, txtNameH);
}
</snip>
<snip>
if(txtPasswdH) {
err = MemHandleUnlock(txtPasswdH);
// EITHER ADD THIS NEXT LINE
MemHandleFree(txtPasswdH);
// OR THIS NEXT LINE
FldSetTextHandle(passwdFld, txtPasswdH);
ErrFatalDisplayIf(err, "Could not Unlock chunk in password
field.");
}
</snip>
Regards
John Sutton
--
For information on using the PalmSource Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/