lua-users home
lua-l archive

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




Am 03.09.2018 um 17:18 schrieb Zhao Han:
Hi, All,

For a weak table, is it possible to use some meta table tricks to track the changes of the table?

e.g. when a key or value get collected, print a message.

Best Regards,
/hz
You could try to use the __gc field at a metatable at the objects that are going to get collected

--
Oliver