lua-users home
lua-l archive

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


__unreference should call immediately when reference count to zero,
unliket __gc it is called latter then there is no way to stand more or
when explicitly call collectgarbage()

вт, 25 июн. 2019 г. в 08:24, Matthew Wild <mwild1@gmail.com>:
>
> On Mon, 24 Jun 2019, 19:49 Sergey Kovalev, <kovserg33@gmail.com> wrote:
>>
>> I wonder why method is named __toclose but not __noreference ?
>
>
> Because it doesn't mean there is no reference, that's what __gc is for already.
>
> The method is called when a specific variable referencing the value goes out of scope. There may be other variables still happily referencing the value.
>
> Regards,
> Matthew