Re: weakref semantics



On Wed, 2008-01-16 at 15:03 +0000, jcupitt gmail com wrote:
> I noticed the weakref introduction says that notifies can be called many times:
> 
> http://library.gnome.org/devel/gobject/unstable/gobject-memory.html#gobject-memory-weakref
> 
>    ... which is invoked when the object runs its dispose method. As such,
>    each weak ref can be invoked more than once upon object finalization
>    (since dispose can run more than once during object finalization).
> 
> I'm not sure this is right: looking at the source for gobject it seems
> that the notifies are a fire-once thing, and are removed upon firing.
> 
> Should I open a docs bug on this? (or am I confused?)

I actually have a related question. I remember that weak refs weren't
allowed to ressurect the object. However, with the weak ref callbacks
running from dispose, and dispose being allowed to ressurect the object,
why can't weak refs ressurect?

Maybe weak ref callbacks should be moved to finalization?



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