Re: closure floating



On 16 Jan 2001, Owen Taylor wrote:

> Tim Janik <timj gtk org> writes:

> I'm of the opinion that setting a closure in a persistant manner -
> g_signal_connect_closure(), g_timeout_set_closure(), whatever can sink
> the closure. This is much like gtk_container_add(). But simply
> _using_ a closure for, say, gtk_container_foreach_closure() -
> as an argument to a function call should not not sink the closure.
> 
> The operation of 'sink' basically represents transfer of ownershop -
> but an operation like g_signal_closure_foreach() should not
> retain a refcount to the closure and thus cannot become
> the owner of the closure.

unfortunately i'm not sure users will find it intuitive that
signal_connect() takes over the ownership as timeout_set_clousre,
but _foreach not doing so.
from a simple usage level, they probably want to be able to use
g_cclosure_new() inlined in all of those function calls, don't
you think? (and if they still do, while _foreach doesn't sink,
we'll silently leak closures all over the place)

> 
> Regards,
>                                         Owen
> 

---
ciaoTJ





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