I am developing an app that does very frequent redraws of the whole scene, i.e. dumping the entire scene and drawing a new one.
When I watch my app's memory use in the task manager, I can see that it steps up every time the scene is redrawn, but no memory is released when I tear down the old scene, so it just keeps going up which eventually leads to a crash. I assume I'm not properly cleaning up the old scene before I start drawing the new one.
I'm using removeNode to delete the old scene. At first I thought calling removeNode cleaned up everything at and below the calling nodepath. But a bit of experimenting showed that if you keep a reference to a child nodepath, it won't be cleaned up when you call removeNode on the parent. Does removeNode clean up children that don't have any references? What is the most efficient way to clean up everything under a specified nodepath regardless of whether there are references to some of its children?
Thanks.
