Here's how Address works:
a) If you never modify in any table field, the field handles are freed by
the OS when you exit the form.
b) If you modify a table field, then PrvEditSaveRecordField() is called. The
last line of this function is FldFreeMemory() which frees the old field.
Then, that row gets redisplayed, allocating another handle, which is
eventually freed as in case (a).

This method only works if you are really careful to never re-display a table
row. You can make it a more robust by calling FldGetTextHandle() in the
"get" function to see if there is already a handle allocated from a previous
display of the table, and freeing it first.

You can also use a more brute-force approach, which saves all allocated
field handles in an array indexed by row, and nulls out the array entries in
the "save" function. In your frmCloseEvent handler, walk through the array
and free any handles remaining.

Hope that helps...

Dave
"Christian Lindemeier" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> I've tried the PrvEditGetRecordField example, it works fine after I've
ajusted
> it for my use but I didn't get rid of my memory leak problem.
> I think this is because there isn't any MemHandleFree(fieldH).
> Maybie there is something I missed.
>
> Chris
>
> "Palm Developer Forum" <[EMAIL PROTECTED]> schrieb am
10.10.03 03:36:25:
> >
> > You should use customTableItem for first column and textTableItem for
2nd
> > column. For a good example of how to do a textTableItem, look at the
source
> > code for the built-in Address app, included with the SDK. See file
> > AddrEdit.c, functions PrvEditGetRecordField and PrvEditSaveRecordField.
> >
> > Dave
>
____________________________________________________________________________
__
> Bestes Testergebnis: Stiftung Warentest Doppelsieg fur WEB.DE FreeMail
> und WEB.DE Club. Nur fuer unsere Nutzer! http://f.web.de/?mc=021182
>
>
>



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

Reply via email to