Strangely enough Alex, I think you may have helped with a similar problem before:
http://forums.coronalabs.com/topic/41933-memory-leak-or-something-else/
Strangely enough Alex, I think you may have helped with a similar problem before:
http://forums.coronalabs.com/topic/41933-memory-leak-or-something-else/
What can I say, I get around
Using removeBody doesn’t actually remove the reference or the object, it just removes the physics body which is only part of the battle. To confirm, you can stick in print statements for your objects to see if they are being niled out.
Removing an object from memory necessitates using the display.remove/removeSel() APIs, and then niling the reference to the variable:
Ex:
Thing = display.newImage(“onething.png”)
– sometime later when no longer needing Thing object:
Thing:removeSelf()
Thing=nil
Sorry for lack of formatting, I’m mobile right now. Let me know if that makes sense and it helps resolve the issue.
I really thought Storyboard would handle the objects held within the display group (especially as I’m calling removeScene… I’ll have a play around with removing the objects manually, but I’m beginning to wonder if that’s the problem at all.
I have a ‘return to game’ button on my menu, like the problem ‘linked’ above… And the frame-rate is steadily slowing down in exactly the same way. I’ve just tried running the code without ANY runtime listeners, but that hasn’t fixed it. This is a weird one.
Hi,
Is thing local?
If not try,
local thing = display.newImageRect( “images/thing.png”, 474, 474 )
Good Luck!
burhan
I would call physics.stop() (or physics.pause()) in the exitScene() function. I would also explicitly remove the collision Listener in exitScene as well. This means you need to call physics.start() in enterScene as well as add the collision listener there.
Rob
From the code you have posted thus far, i dont see you inserting your objects into storyboards display group anywhere? If you are not doing that, it won’t remove them for you
Oh dear, yes… My group was under the wrong executable. I suck.