Is Composer supposed to work like this ?
If I create and promptly destroy a scene like this:
local composer = require( "composer" ) composer.loadScene("demoscene") composer.removeScene("demoscene")
it’s supposed to free up the resources used by the scene, I think. If I look at the view member of the scene, it has indeed been set to nil by this.
If I take the standard scene template and add this to create()
local newGroup = display.newGroup() newGroup:insert(display.newRect(0,0,100,100)) sceneGroup:insert(newGroup) \_G.group = newGroup \_G.scene = self
This creates a group, sticks a rectangle in it, and inserts it into the scene group (self.view)
If I print out _G.scene.view after removing it, then it prints nil as you would expect - the view is removed as part of Composers Garbage collection.
However, if you print _G.group.numChildren it prints 1, implying that the rectangle is still in the group, printing the references shows it is the same child.
The composer.removeScene documentation says _ “If shouldRecycle is omitted or set to false (default), the scene will be removed entirely, including its scene object” _but it apparently isn’t ?
Any ideas ? Do you basically have to clean up groups in destroy ?