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/

Reply via email to