Created
May 3, 2014 14:40
-
-
Save katlogic/e52be9dad4290170ac64 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local resurrect | |
local t = setmetatable({}, { | |
__gc = function(t) | |
print("resurrecting") | |
resurrect=t | |
end | |
}) | |
local weak = setmetatable({x=t}, {__mode="v"}) | |
t = nil | |
collectgarbage() | |
print(weak.x) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment