Hi I’m new to programming and just wondering what the difference is between using object:removeSelf() on the group vs iterating through the group and removing the children first before removing the group? Is there a big difference in the memory that you get back?
I know there is more good answer than this but based on my understanding *If your object:removeSelf() means group:removeSelf()* If you remove the group directly without iterating then there is no way for you to remove its child’s memory usage. *Were the childs memory usage will still be there and also with texture usage*
Iterating first is much better before removing the group
Hope this helps =)
Thanks that does help.
I know there is more good answer than this but based on my understanding *If your object:removeSelf() means group:removeSelf()* If you remove the group directly without iterating then there is no way for you to remove its child’s memory usage. *Were the childs memory usage will still be there and also with texture usage*
Iterating first is much better before removing the group
Hope this helps =)
Thanks that does help.
There is no difference. If you remove the group, all its children will be removed.
Source: http://docs.coronalabs.com/guide/media/displayObjects/index.html#TOC
This method removes all children in a display group — all you need to do is remove the display group itself and then nil its reference.
display.remove( myGroup )
myGroup = nil–OR
myGroup:removeSelf()
myGroup = nil
There is no difference. If you remove the group, all its children will be removed.
Source: http://docs.coronalabs.com/guide/media/displayObjects/index.html#TOC
This method removes all children in a display group — all you need to do is remove the display group itself and then nil its reference.
display.remove( myGroup )
myGroup = nil–OR
myGroup:removeSelf()
myGroup = nil