Re: [gnet] Problems with GNet and GIOChannels...



On Thursday 26 August 2004 15:35, James Wiggs wrote:

>    Do you explicitly free the data out of your GConnEvent structures
> after reading it into your own variables?  Any problems with that?

  There is a problem with that :-)

  As the GConn API reference says under 'struct GConnEvent': "GConn Event. 
buffer and length are set only on GNET_CONN_READ events. The buffer is 
caller-owned." 

  "caller-owned" = owned by GNet, do not free under any circumstances. GNet 
will take care of that.


> Are they using GChunks or something, where you should not free them
> with g_free()?  

  Don't worry about freeing the buffers at all. Just copy the data to your own 
buffer if you can't process it right away.

Cheers
 -Tim




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]