[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: __gc visible to lua code...
- From: Graham Wakefield <lists@...>
- Date: Fri, 30 Mar 2007 02:21:37 -0700
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