Hi padiyar,

        Do not assign NULL value to first for loop. Then check your code.

Rangababu TNV.

-----Original Message-----
From: veena padiyar [mailto:[EMAIL PROTECTED]
Sent: Friday, May 30, 2003 11:00 AM
To: Palm Developer Forum
Subject: Memory leak problem


hello,
  I am using a 2 dimensional dyanamic array. this is
the code
Int16 **arrayColOne;
arrayColOne =(Int16 **) MemPtrNew(sizeof(Int16 *) *
6);

for(i=0; i<6; i++)
arrayColOne[i] = NULL;

for(i=0; i<6; i++)
{
arrayColOne[i] =(Int16
*)MemPtrNew(sizeof(Int16)*size);
if(!arrayColOne[i])
FreeMem();
}

void FreeMem()
{
   UInt16 i;
   
   if(arrayColOne)
   {
       for(i=0; i<6; i++)
       {
        if(arrayColOne[i])
        MemPtrFree(arrayColOne[i]);
       }
       MemPtrFree(arrayColOne);
   }
}

i am calling FreeMem in frmCloseEvent for that form.
thank u                                 

__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

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


"THIS E-MAIL MESSAGE ALONG WITH ANY ATTACHMENTS IS INTENDED ONLY FOR THE
ADDRESSEE and may contain confidential and privileged information.
If the reader of this message is not the intended recipient,
you are notified that any dissemination, distribution or copy of this 
communication is strictly Prohibited. 
If you have received this message by error, please notify us 
immediately, return the original mail to the sender and delete the 
message from your system."


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

Reply via email to