I was wondering how far I need to go to remove display objects and variables.
Lets say you have a group that you’ve inserted multiple objects into such as rect, line, text.
local grp = display.newGroup() grp.foo = "abc" gtp.bar = 123 local rect = display.newRect(0,0,100,100) grp:insert(rect) local line = display.newLine(0,0,100,100) grp:insert(line) --... at some point later, remove the group grp:removeSelf() grp = nil
What happens to the variables, rect and line? Does it get lost until it’s collected by the gc? Does calling removeSelf on the group also recurse through the children? What about the variables foo and bar?
Extra question: Does the above answer apply to other types such as display.newContainer and composer.newScene?