-
-
Save kn666/fa383c74e9cc43a88f1530c4c6ead362 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