[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: __gc metamethod bug
- From: Karel Tuma <kat@...>
- Date: Thu, 06 Nov 2014 21:15:49 +0100
Excerpts from Chris Cummings's message of 2014-11-06 21:05:24 +0100:
> Or have I totally missed something :)
>
> -Chris
This is documented, specifically:
http://www.lua.org/manual/5.2/manual.html#2.5.1
"You mark an object for finalization when you set its metatable and the metatable has a field indexed by the string "__gc". Note that if you set a metatable without a __gc field and later create that field in the metatable, the object will not be marked for finalization. However, after an object is marked, you can freely change the __gc field of its metatable."