Hi Luis,

I'm afraid I can't see anything wrong with that code.

How do you know it's failing?

If you run it on the emulator it should give useful diagnostics for memory
leaks.

Regards,

On 12/12/06, Luis Cordova <[EMAIL PROTECTED]> wrote:
>
> forgot to paste this:
>
> for (i=0; i <16; i++) {
>    itemList[i] = (char *) MemPtrNew(80);
>
> then I use StrCopy(itemList[i], label)
>
> On 12/12/06, Pinus Alba <[EMAIL PROTECTED]> wrote:
> > Hi Luis,
> >
> > There should (normally) be a MemPtrFree for every block of memory
> allocated
> > by MemPtrNew.
> >
> > In the code you show there is only one MemPtrNew which requests a block
> of
> > memory 64 bytes long (16*sizeof (char*)).
> >
> > How are you assigning values to the pointers within gListChoices?
> >
> > Regards,
> >
> > On 12/12/06, Luis Cordova < [EMAIL PROTECTED]> wrote:
> > > Declaring the variable:
> > > -------------------------------
> > > // top of source file
> > > char **gListChoices=0;
> > >
> > > // within block of code
> > > itemList = (Char **) MemPtrNew(16 * sizeof(Char *));
> > > gListChoices=itemList;
> > >
> > > Releasing the variable:
> > > -------------------------------
> > > Int16 i;
> > >    if(gListChoices!=0) {
> > >       for(i=0; i<16; i++) {
> > >          MemPtrFree((MemPtr) gListChoices[i]);
> > >       }
> > >    MemPtrFree((Char **) gListChoices);
> > > }
> > >
> > > It is a global variable for a list that is displayed in a form.
> > >
>

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

Reply via email to