Ai Lee Tang wrote:
Hi all,
My application will generate an error message when the list reached 12
lines and i do a deleting of a record. It will immediately prompt me an
error message, "MemoryMgr.C, line:3654 Free Handle".
Following is my coding.
OrderRecordType recordHeaderP;
MemHandle recordHeaderH;
char totallineP[2];
Int32 totalline;
//update no of order detail line created
OrderHeaderGetRecord (OrderHDB, ListCurrentRecord, &recordHeaderP,
&recordHeaderH);
totalline = StrAToI(recordHeaderP.detailCreated);
totalline = totalline + i;
StrIToA(totallineP,totalline);
OrderHeaderChangeRecord (OrderHDB, &ListCurrentRecord,
orderHDetailCreated, totallineP);
MemHandleUnlock(recordHeaderH);
It's very hard to guesswhat the problem is without knowing
what OrderHeaderGetRecord() does. Does it lock the handle?
Does it do a DmGetRecord() or DmQueryRecord()?
Also, what about OrderHeaderChangeRecord() -- does that function
delete a record and create a new one, or even just resize one?
If so, then it may be modifying (and thus invalidating) the handle
stored in recordHeaderH, because that's a handle to a record that
might not exist anymore.
- Logan
--
For information on using the Palm Developer Forums, or to unsubscribe, please
see http://www.palmos.com/dev/support/forums/