__gc for non-userdata?
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: __gc for non-userdata?
- From: Fabien <fleutot+lua@...>
- Date: 2007年8月23日 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.
-- Fabien.