Hi all,

Here's my code looks like :


// global
char        **gsListBuffer;

static void AppEventLoop(void)
{
    int i;

    gsListBuffer = (char **) MemPtrNew ( 8 * sizeof (char*) );

    for ( i = 0; i < 8; i++ )    gsListBuffer[i] = (char *) MemPtrNew (50);

   do
   {
     ....
   } while ();
}

static void AppStop(void)
{
    int i;

    // free listbox buffer
    for ( i = 0; i < 8; i++ )  MemPtrFree ( (char *)gsListBuffer[i] );

    MemPtrFree ( (char **) gsListBuffer );

    ....
}


When I quit my application, I got an error "Invalid Chunk ptr". It seems
that I do not free the memory allocated correctly, but I don't see what is
wrong in my code ???

Please advise needed.

Thanks in advance,

agus

-- 




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

Reply via email to