lua-users home
lua-l archive

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


Hi,

Today I discovered that a __gc method installed on a userdata metatable is visible to Lua code; when called out of context it is likely to cause crashes, so any __gc metamethod in C must typecheck the argument.

I was surprised to find this out, I thought __gc would be 'hidden' from Lua. I'm not sure I can think of a reason why you'd want to call a userdata's __gc from lua code.

Thought others should know.

Graham