Hi,
lifetime of the packP variable is among the lock/unlock calls. However, you
use it thereafter.
Best regards,
Jan Slodicka
----- Original Message -----
From: "Chris Engler" <[EMAIL PROTECTED]>
Newsgroups: palm-dev-forum
To: "Palm Developer Forum" <[email protected]>
Sent: Friday, May 27, 2005 8:05 AM
Subject: "unlocked chunk of memory" error
> I am using the code below to create a list. However it keeps giving me an
> "unlocked chunk of memory" error. I have tried several different
> arrangements using StrCopy and MemMove but I continue to get this error.
I
> must be overlooking something. Please, someone offer me some suggestions.
> Thank you!
>
> Char ** gPackList = 0;
> Char packBuffer[21] = "";
> Boolean addToList = true;
>
> some code...
>
> case frmOpenEvent:
> gPackList = (Char **) MemPtrNew(packListSize * sizeof(Char*));
>
> some code...
>
> if (addToList)
> {
> UInt32 len = StrLen(packBuffer);
> MemHandle packH = MemHandleNew(len + 1);
> Char* packP = (Char*)MemHandleLock(packH);
> MemMove(packP, packBuffer, len + 1);
> MemHandleUnlock(packH);
> packH = 0;
> gPackList[indexLst] = (Char*)packP;
> indexLst++;
> }
>
> some code...
>
> Best Regards,
>
> Chris Engler
>
>
>
> --
> For information on using the PalmSource Developer Forums, or to
unsubscribe, please see http://www.palmos.com/dev/support/forums/
--
For information on using the PalmSource Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/