Re: [AD] user-defined events

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Saturday 27 September 2008, Peter Wang wrote:
> On 2008-09-27, Elias Pschernig <elias.pschernig@xxxxxxxxxx> wrote:
> > No matter how many fields are added though, it never will be nice. How
> > well would using just a single void *data work instead?
> >
> > It would be allocated whenever an event is emitted - but would it be
> > clear to users where to free it? For example, what if the event is never
> > received, or what if to event queues are receiving the events?
> >
> > I think we should make sure the above works, if it does not right now.
> > It's the only way I can see this useful - if necessary, we might have to
> > provide a callback pointer with a "cleanup_user_event" method which is
> > passed the event when it goes out of servrice or something, so user code
> > can free the data poiner there. (But maybe that's already working..
> > didn't look too close yet and the example apparently just casts an int
> > to a pointer.)
>
> It doesn't have any support for freeing user data in user events.
>
> Not sure what to do about it.

include a pointer to a free method? send a "FREE_USER_EVENT" event? (lol)

> Peter
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge Build the coolest Linux based applications with Moblin SDK & win
> great prizes Grand prize is a trip for two to an Open Source event anywhere
> in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/


-- 
Thomas Fjellstrom
tfjellstrom@xxxxxxxxxx




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/