[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Userdata finalization order
- From: Francesco Abbate <francesco.bbt@...>
- Date: Sun, 17 Oct 2010 20:59:52 +0200
2010/10/17 E. Toernig <froese@gmx.de>:
> As both, "a" and "b", become unreachable, Lua is right to collect both
> of them. And it will call the gc-method in reverse order of creation:
> if "b" was created before "a" (should be, as "a" needs "b") it will
> call "a.gc" and then "b.gc".
>
> If Lua calls "a.gc" before "b.gc" even if "a" was created earlier than
> "b" then it's a bug.
Thank you for the precision. Please note that I didn't say that this
is a bug, I just said that the utilisation of an env table for
userdata is not suitable to ensure a proper finalization order for the
objects and your remark actually confirms that.
--
Francesco