Dominic Diascro, III wrote:
I'm running into a memory handle problem. My program
implements a 5 column, 10 row table. If I start the
program and run any of the counter functions (there's
a timer implemented), and then exit, it works fine.
If I put the cursor in any of the table fields and
try to exit, I get the error: MemoryMgr.c, Line:3670,
Free Handle. If I tap into a table cell and then tap
out of it and then exit the program, it is fine.
I'm thinking I need to free the pointer for the cursor.
That sound right?
I'm fairly sure that the "Free Handle" message means the
opposite. In other words, it means "you asked me to free
this handle, but I detected that it was already freed".
The MemHandles that are associated with fields in Palm OS
are freed automatically by the system when the form closes.
The field "owns" the MemHandle.
I would check for some point where you change the text of
a field by assigning it a new MemHandle, and then after
you assign the handle to the field, you end up freeing it.
You should never do something like this:
FldSetTextHandle (fieldptr, myhandle);
MemHandleFree (myhandle); // wrong!
Of course, it might be that your handle is freed somewhere
much later -- it doesn't have to be right after the
FldSetTextHandle() for there to be a problem.
- Logan
--
For information on using the PalmSource Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/