Unable to free allocated memory at form close time
without getting an error message.  Memory is allocated
and attached to a gadget using SetGadgetData(fldId,
data).  Data is successfully accessed and used during
form processing.  

Get different error if memory is not freed
(systemmgr.c, Line:3986, Minor error while exiting
app: un-freed chunk at 0x00F7D5C0, size 214 (ownerID
2)) 

Any ideas or suggestions are appreciated.

----------DETAILS----------
Fatal Alert:
form.c, Line:5570, NULL form

Produced from:
Err destroyMyGadget(Word fldId)
{
        Err retVal;
        tableGameDefnPtr data;
--->    data = GetGadgetData(fldId);
        if(data != NULL)
        {
                retVal = MemPtrFree(data);
        }
        return retVal;
}

Called from:
Boolean MyGadgetHandleEvent(FormGadgetType *p, UInt16
cmd, void *paramP)
{
        switch(cmd)
        {
                case formGadgetDeleteCmd:
                        destroyMyGadget(p->id);
                        break;
                case formGadgetDrawCmd:
                        DrawTableGame(p->id);
                        break;
                case formGadgetEraseCmd:
                        break;
                case formGadgetHandleEventCmd:
.
.
.

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

Reply via email to