You need to call MemHandleUnlock for each of your handles stored in
AllItem[] and MemHandleFree after you have finished with the the list (but
don't free it before you finish).

Hope this helps.

Jacky

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Sam
Trimble
Sent: Thursday, February 22, 2001 6:33 AM
To: Palm Developer Forum
Subject: Clean up....


I'm using the following code to create a string list for a list and when I
exit the app I'm getting "SystemMgr.c Line:4192, Possible memory leak....."
Would anyone let me know what kind of clean up I need to do after doing
this. Thanks...

Char    CurItem[35];
CharPtr *AllItems;
VoidHand txtH;
Int x = 0;
Int i = 0;

 for (x = 0; x < NumOfChoices; x++) {
  StrCopy(CurItem, ReturnSelection(1, x));      ///ReturnSelection is my own
function for returning the item that needs to be in that place
  txtH = MemHandleNew(StrLen(CurItem) + 1);
  AllItems[i] = MemHandleLock(txtH);
  StrCopy(AllItems[i], CurItem);
  i++;
 }
LstSetListChoices(List*, AllItems, NumOfChoices);



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


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

Reply via email to