"DeVon Fowler" <[EMAIL PROTECTED]> wrote in message
news:102407@palm-dev-forum...
>
> Unable to free allocated memory at form close time
> without getting an error message.
>
> [...]
>
> ----------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;
> }

The "NULL form" error message is a good clue.  What does your GetGadgetData
code look like?  Does it depend on a pointer to the active Form?  Since the
the formGadgetDeleteCmd callback is called from FrmDelete, that dependence
might not be a good idea.

Why pass the ID to destroyMyGadget?  Why not pass a pointer to the gadget
directly from the callback?



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

Reply via email to