Hello

I have implemented the TableLoadDataFuncType function to draw the textItem
of the table.
I am drawing the text elsement from the gloabl array g_pAcceptDataSet.
It is working fine, but it gives me the memory leak error for the
g_pszField. So actually this memory should be free by the TableManager?
Following is my load function

Err fnGetData(void * table, Int16 row, UInt16  column, Boolean  editable ,
MemHandle *textHP, UInt16 * textOffset, UInt16 * textAllocSize, FieldPtr
fld)
{
     MemHandle fieldH;
     UInt16 fieldSize;

     if (NULL != g_pAcceptDataSet[row  + g_nAcceptTopItem])
     {
          fieldSize = StrLen(g_pAcceptDataSet[row  + g_nAcceptTopItem]) + 1;
          fieldH = MemHandleNew(fieldSize);
          g_pszField = (char*)MemHandleLock(fieldH);
          MemMove(g_pszField, g_pAcceptDataSet[row  + g_nAcceptTopItem],
fieldSize);
          *textAllocSize = fieldSize;
          MemHandleUnlock(fieldH);
     }
     else
     {
          fieldH = 0;
          *textAllocSize = 0;
     }
     *textOffset = 0;         // only one string
     *textHP = fieldH;

     return (0);
}

With Regards,
Amit Kalekar
[EMAIL PROTECTED]
Kalpadrum Infotech Pvt.Ltd.
www.kalpadrum.com


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

Reply via email to