[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Userdata finalization order
- From: Wesley Smith <wesley.hoke@...>
- Date: Sun, 17 Oct 2010 16:02:05 +0000
On Sun, Oct 17, 2010 at 3:11 PM, Javier Guerra Giraldez
<javier@guerrag.com> wrote:
> On Sun, Oct 17, 2010 at 6:24 AM, Francesco Abbate
> <francesco.bbt@gmail.com> wrote:
>> suppose now that both "a" and "b" becomes unreachable. What happens is
>> that Lua GC will free both of them regardless of the environment table
>> of "a" and so the finalisation order can be violated.
>
> is that true?
>
> what i would expect is that "a" is unreachable, but GC considers "b"
> reachable by "a", even if "a" isn't, so "b" would only be collected
> after "a" (in a different GC cycle)
Except when you close the state and everything is suddenly collectable.