Re: reference counting using a pointer

Eduardo Pérez Ureta wrote:
> Could anyone explain me why don't you use:
> void g_io_channel_ref (GIOChannel **channel);
> instead of:
> void g_io_channel_ref (GIOChannel *channel);

you could write an macro for the your case, but the old interface
must stay intact.

but the cleanest way is to use an GC. then you simply do 
iochannel = NULL; an do not need to call the ref functions anymore.
this is the cleanest and most secure way.
(did you read my posting about garbage collection + glib ?)

btw: i've written some libs which also provide an refcounting memory
this also includes finalizers, etc. using this one, there's no need to
refcnt functions for each class.

these libs can be found under:


 Enrico Weigelt 
 meTUX IT Services

 email:     weigelt metux de
 phone:     +49 36207 51833
 cellphone: +49 174 7066481

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