Pinaki Roy wrote:
- but still it's giving memory leak whenever i press
the exit button and i 'm sure it's bocz the memory allocated for ghandle -- how i can free the mem for
ghandle prpperly??
some more observations -
1) i'm calling FrmCloseAllForms() in my AppStop()
function -- and after entering into the main page
without doing anything if press "exit" button it's exiting without any mem leak -- 2) if i add FrmCloseAllForms() in my frmCloseEvent
it's giving Mem Error - SysFatalAlert with the message
"MemoryMgr.c, Line:4384,Free Handle--
3) if i put the FrmCloseAllForms() in ExitButon case
-- there also i 'm getting mem error as read frm
unallocated chunk of memory

Sounds like you have the opposite of a memory leak. That is, I think you're trying to free the handle twice. FrmCloseAllForms() sends a frmClose event to all your forms, including the form that you're in a frmClose handler for. Try calling FrmCloseAllForms() in your app stop logic rather than from a specific form handler. Also, if you add change your frmCloseEvent logic to be similar to this, your error should go away.


case frmCloseEvent:
        for(i=0;i<kNumTextColumns;i++)
        for(j=0;j<kNumRows;j++)
        {
                if(gHandles[i][j]) {
                        MemHandleFree(gHandles[i][j]);
                        gHandles[i][j] = 0;
                }
        }
        handled = false;
        break;



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

Reply via email to