[ENet-discuss] when to delete allocated buffers?
Lee Salzman
lsalzman1 at cox.net
Fri Dec 18 14:38:34 PST 2009
Packets allocate their own copy of the data, so once you send them, you
don't need to free anything since ENet handles that itself. However, the
packets ENet gives to you on RECEIVE events, you must remember to
destroy them when you are done with them.
Lee
Jay Sprenkle wrote:
> Good afternoon all,
>
> <Newbie usage question alert>
>
> After reading through the enet source it appears that when you send a
> packet of data a structure containing a pointer to the data is queued
> up to send. If I malloc() or new a buffer, fill it, then send it, how
> do I know when I can safely delete it? I don't see an event for sent
> data, etc.
>
> Thanks!
>
> </Newbie usage question alert>
More information about the ENet-discuss
mailing list