For example, I created a table this way
myTable = {}
for n=1,5
local item = {
name = "item"..n,
id = n,
}
myTable[n] = item
end
If this table is no longer used to free this table for the garbage collector,
Do I need to scroll through a table to assign each element a zero?
for n=1,5
myTable[n] = nil
end
or all i need to do is assign table zero?
myTable = nil
In addition to the above, if a table element has some property that is assigned to some other table, do I also need to reset them separately?
for n=1,5
myTable[n].someTable = nil
myTable[n] = nil
end
myTable = nil
source
share