here is my code 4 the list it is give memoy lick error when exit the
application
static void TodayAppList(FormType* frm)
{
SysDBListItemType *dbListIDsP;
MemHandle dbListIDsH;
static UInt16 dbCount = 0;
UInt16 counter;
Boolean status;
ListType* lst;
static char **ItemType;
UInt16 ListItemNum;
// item = MemPtrNew(20);
//MemSet(item,20,'\0');
if(ItemType)
{
for(counter=0;counter<dbCount;counter++)
{
MemPtrFree(ItemType[counter]);
}
MemPtrFree(ItemType);
dbCount=0;
}
status = SysCreateDataBaseList(sysFileTApplication, 0,&dbCount,
&dbListIDsH,true);
ItemType = (Char**)MemPtrNew(dbCount * sizeof(Char*));
dbListIDsP = (SysDBListItemType*)MemHandleLock (dbListIDsH);
if (status == true && dbCount > 0)
{
for (counter = 0; counter < dbCount; counter++)
{
ItemType[counter] = (Char*)MemPtrNew(dmDBNameLength+1);
StrCopy(ItemType[counter], dbListIDsP[counter].name);
}
lst = (ListType*)FrmGetObjectPtr(frm,FrmGetObjectIndex(frm,
TodayPrefList));
LstSetListChoices (lst,ItemType,dbCount);
ListItemNum= LstGetSelection (lst);
item= LstGetSelectionText(lst,ListItemNum);
MemHandleUnlock(dbListIDsH);
MemPtrFree(dbListIDsP);
}
}
and i think it is bcz of this
ItemType = (Char**)MemPtrNew(dbCount * sizeof(Char*));
--
For information on using the PalmSource Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/