Hi all,
Imagine that we have an object:
local obj = {}
obj.id = 0
obj.increase = function()
obj.id = obj.id + 1
end
obj.print = function()
print(obj.id)
end
I added a destroy function:
local obj = {}
obj.id = 0
obj.increase = function()
obj.id = obj.id + 1
end
obj.print = function()
print(obj.id)
end
obj.destroy = function()
obj.id = nil
obj.increase = nil
obj.print = nil
obj.destroy = nil
end
Do I need a destroy function? When I set to obj = nil does GC remove all variables and methods in obj? [import]uid: 5629 topic_id: 24207 reply_id: 324207[/import]