Daniel Hartwig <mand...@gmail.com> skribis: > On 8 October 2012 21:44, Ludovic Courtès <l...@gnu.org> wrote: >>> On 8 October 2012 04:38, Ludovic Courtès <l...@gnu.org> wrote: >>> Right. But then the pointer is being collected even though it remains >>> inside the guardian, in the example it is never extracted from there. >> >> Well, when the object reaches the guardian’s zombie list, that’s because >> it’s been finalized, so any weak references from that object can also be >> nullified. > > Ah. So I thought that being in the zombie list prevented any > finalization, thus when the guardian returns an object it is still > fully functional and only after the reference is lost again does it > really get finalized.
Well, the object is still usable when the guardian returns it, because it’s been kept alive by the finalizer (‘finalize_guarded’ in guardians.c). Now, whether weak references from the object are subject to “nullification” by the GC is clearly a gray area, but I’m not surprised that it is. >> How does it help? Should we close the bug? :-) > > Sure. At least you seem convinced and you has actually hacked on it :-) Good. :-) So closing it now, but feel free to reopen if you think something’s wrong. Thanks, Ludo’.