Since I started working with Microsoft back a few months now, I have been focusing nearly 100% on Papervision3D-related projects. We are basically building new ways to advertise on Microsoft sites, moving beyond the normal banner or 300×250 ad (more on this as the products are released). We were running into problems with processor usage & memory leaks when you would use a Bitmap Material, then try to remove it (via removing the object using it).
After a while, you could easily start putting the processor usage up near 100%, especially if you are using dynamic object creation/removal, and are not making sure you totally clear out the material & all references.
We searched through the docs & internet for days trying to figure it out, eventually found this, which helped us along our way. In his post, Idoru mentions we need to update the destroy() method, but the PV team seems to have fixed that since his post was made.
To really clear the Material, you need to
// Set material interactive & animated to false
my_material.animated = false;
my_material.interactive = false;
// Remove all EventListeners
my3DObject.removeEventListener(InteractiveScene3DEvent.OBJECT_CLICK, clickHandler);
my3DObject.removeEventListener(InteractiveScene3DEvent.OBJECT_OVER, overHandler);
my3DObject.removeEventListener(InteractiveScene3DEvent.OBJECT_OUT, outHandler);
// Remove Child from Display
my3DGroup.removeChild(my3DObject);
// Run the destroy function on the material
my_material.destroy()
// Null out all of the things involved
movie = null; (if using a MovieMaterial i.e. my_material.movie)
my3DObject = null;
my3DGroup = null;
my_material = null;
This should work the same with all of the Materials too.