I am wrking on pods 4 garnet 5.4 simulator on the eclipse 3.0.1 i also
try to write the memory free code at frm close event it also not wrk.
static void TodayPreference(FormType* frm)
{
SysDBListItemType *dbListIDsP;
MemHandle dbListIDsH;
static UInt16 dbCount = 0;
UInt16 counter;
Boolean status;
ListType* lst;
static char **ItemType;
if(ItemType)
{
for(counter=0;counter<dbCount;counter++)
{
MemPtrFree(ItemType[counter]);
}
MemPtrFree(ItemType);
dbCount=0;
}
if(frm)
{
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);
MemHandleUnlock(dbListIDsH);
MemPtrFree( dbListIDsP);
}
}
}
if i use the MemPtrFree( dbListIDsP); it decrease the memory lick to 33 else
it give the size as 780 which is due to
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/