[ENet-discuss] when to delete allocated buffers?

Nuno Silva little.coding.fox at gmail.com
Fri Dec 18 14:46:37 PST 2009


And just in case you didn't get it, you can delete the data after you tell
enet to send the packet, since enet creates it's own copy of the data.

On Fri, Dec 18, 2009 at 10:38 PM, Lee Salzman <lsalzman1 at cox.net> wrote:

> 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>
>>
>
> _______________________________________________
> ENet-discuss mailing list
> ENet-discuss at cubik.org
> http://lists.cubik.org/mailman/listinfo/enet-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cubik.org/pipermail/enet-discuss/attachments/20091218/85f78c64/attachment.htm>


More information about the ENet-discuss mailing list