Palm OS Reference states: FrmRemoveObject does not free memory allocated to a 
string in an editable field.
Therefore you will first have to call FldGetTextHandle & if a valid handle is 
returned call MemHandleFree on all fields.
In addition I suggest removing all objects in reverse, thus lomiting overhead. 
I would do it as follows


void DePopulatePage()
{
        FormPtr frmPtr;
          UInt16 index, objectID;
                
        frmPtr = FrmGetFormPtr(MainForm);
        index = FrmGetNumberOfObjects(frmPtr);
           while (index)
        {
                  index--;
                  objectID = FrmGetObjectID(frmPtr, index);
                if (objectID >= initID&&objectID <= lastID; i++)
                  {
                    
FrmHideObject(frmPtr,index);
                    // delete any object memory here
                       
FrmRemoveObject(&frmPtr,index);
                 }
          }
}

Lionscribe


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

Reply via email to