Should Read:
> I find myself facing one, last, memory leak indicated by the emulator to
be tied to a database record creation function. Of course, if this is
merely a matter of the emulator identifying that I am allocating memory to a
couple of records and not releasing it back to the system, and calling that
a memory leak, that is another matter. (Can I turn off emulator error
detection for this case?)
>
> The function to write the record is:
>
> static int CreateRecord(TransStructType r, UInt16 index)
> {
> MemHandle h;
>
>
>
> h = DmNewRecord(gTransformer, &index, sizeof(r));
>
> if (h) { // could fail due to out of memory!
> MemPtr p = MemHandleLock(h);
> Err err = DmWrite(p, 0, &r, sizeof(r));
> MemHandleUnlock(h);
> DmReleaseRecord(gTransformer, index, true);
>
> }
> return 1;
> }
>
>
> If anyone might give me some indication of how to approach this, I would
certainly appreciate it.
>
> Thank you.
----- Original Message -----
From: "Del Ventruella" <[EMAIL PROTECTED]>
To: "Palm Developer Forum" <[email protected]>
Sent: Sunday, November 20, 2005 5:13 PM
Subject: Is this a "memory leak" that I want to keep?
> I find myself facing one, last memory leak indicated by the emulator to be
tied to a record creation function within a database. Of course, if this is
merely a matter of the emulator identifying that I am allocating memory to a
couple of records and not releasing it back to the system, and calling that
a memory leak, that is another matter (although I'd like to know if I can
such the detection of this error off for this case).
>
> The function to write the record is:
>
> static int CreateRecord(TransStructType r, UInt16 index)
> {
> MemHandle h;
>
>
>
> h = DmNewRecord(gTransformer, &index, sizeof(r));
>
> if (h) { // could fail due to out of memory!
> MemPtr p = MemHandleLock(h);
> Err err = DmWrite(p, 0, &r, sizeof(r));
> MemHandleUnlock(h);
> DmReleaseRecord(gTransformer, index, true);
>
> }
> return 1;
> }
>
>
> If anyone might give me some indication of how to approach this, I would
certainly appreciate it.
>
> Thank you.
> --
> 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/