lua-users home
lua-l archive

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


Metamethod __gc allows to perform an action when a userdata is about to be collected. Is there a standard way to do the same with tables?

I can only think of filthy hacks like putting a userdatum with a __gc method in the table; I'd prefer a pure Lua solution.
I'm willing to register these finalisable tables somewhere (presumably in a weak table) if it helps.

-- Fabien.