Yes John that was a pretty silly mistake. Well I have rearranged my whole
code by using frmOpen and frmClose events and everything works very well
now.

Many thanks for your observation.


"John Sutton" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Ok, at second glance (and I'm very tired so I could be wrong)...
Why are you freeing up all the memory that you've allocated for the list
items.  I don't get that?
You have;
   ListChoices = itemList; // save so we can free it later
Unless I'm reading this wrong, itemList and ListChoices are now pointing
to the same place?
Then you do;
             for (i=0; i < ListNumItems; i++)
              MemPtrFree((VoidPtr) ListChoices[i]);

             MemPtrFree((VoidPtr) ListChoices);
             ListChoices=0;
Which has freed up all the memory, and cleared the value of ListChoices,
but then you pass itemList which is pointing to all that memory you have
just let go of;
            LstSetListChoices(listptr, itemList, ListNumItems);
Haven't you just released all the memory that it is pointing at??



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

Reply via email to