Herman,

You comments made me think of something that I do. See function below. My
code works fine, but now Im a bit worried. What I need to know is whether
EvtAddEventToQueue copies the data from the pointer (hopefully) or uses the
pointer when  the event is in the queue and eventually comes out. I assume
it copies it as I use this a lot and it does not crash. Can anyone put my
mind at rest.

Cheers

Rik

void my_funct (void)
{

        EventType user_event;

        user_event.eType = (eventsEnum)userValidMsg;
        EvtAddEventToQueue (&user_event);
}

> -----Original Message-----
> From: Holger Klawitter [SMTP:[EMAIL PROTECTED]]
> Sent: 20 February 2001 08:32
> To:   Palm Developer Forum
> Subject:      Re: how to free memory...
> 
> Herman Badenhorst wrote:
> > 
> > Hi group, if i've got the function below...how can i free the memory
> used by
> > these variables?
> > Thanks
> 
> All variables are on the stack and will be freed after leaving the
> routine. As you are placing a pointer to one of these variables into
> the event queue, the event will not available for the next run of the
> event loop and almost surely crash the pilot pretty soon.
> 
> With kind regards / Mit freundlichem Gruß
>     Holger Klawitter
> --
> Holger Klawitter
> [EMAIL PROTECTED]                             http://www.klawitter.de
> 
> 
> -- 
> For information on using the Palm Developer Forums, or to unsubscribe,
> please see http://www.palmos.com/dev/tech/support/forums/

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

Reply via email to