lua-users home
lua-l archive

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


> 2) the last update 5.2-beta introduce a funny behavior with __gc. Now
> you need to setup a metatable with the __gc entry before the metatable
> is used with an user_data (or it won't be called).

Yes, but you only need to set the index not the value. In other words,
you're free to set __gc=true and set the actual metamethod later.

> And also now __gc is called for tables, which didn't happen before
> (in my code I always try to pick a user data as first argument, and
> suddenly a table appear where user_data used to be)

Only if you do set __gc for tables of course.