Created
July 29, 2015 21:39
-
-
Save Mons/d5e9b7042c7b07bdff2b to your computer and use it in GitHub Desktop.
Class, super and gc
This file contains hidden or 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 weak = setmetatable({},{__mode = 'v'}) | |
do | |
local Class = {} | |
-- function Class:super( class,method ) | |
-- return function () | |
-- print("work") | |
-- end | |
-- end | |
function Class:test() | |
self:super(Class,'method')() | |
end | |
weak.Class = Class | |
-- local o = setmetatable({},{__index = Class}) | |
-- o:test() | |
end | |
collectgarbage('collect') | |
print(weak.Class) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment