[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: __gc for non-userdata?
- From: Fabien <fleutot+lua@...>
- Date: Thu, 23 Aug 2007 20:22:49 +0200
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.