[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Is there a hook for the finalizer/garbage collection of non-user types?
- From: Chris <coderight@...>
- Date: Mon, 6 Mar 2006 11:52:11 -0500
For example, what I want is something like:
a = { ....whatever ... }
b = { __gc = function ...finalizer stuff... end }
setmetatable(a,b)
Then when "a" is collected it will run the __gc function in the
metatable. That doesn't seem to work currently. Or how to
I get this type of functionality? I have a table that has some
external state information that needs to be cleaned up when the table
is destroyed. Is my only choice to manually call some sort of
cleanup function before killing the table?
Thanks
--
// Chris