Lets say we had a page with two buttons, create and destroy. When you click create the Three.js scene in this memory test below is dynamically added to the page and starts running. Clicking destroy should remove the scene, dealocate all buffers and free up all memory etc. http://mrdoob.github.com/three.js/examples/webgl_test_memory.html
Does anyone know how to do this without framing the scene and changing the url?
thanks
I think you need to using the dispose() method in side geometry, material and texture.
geometry.dispose();
material.dispose();
texture.dispose();
https://github.com/mrdoob/three.js/blob/master/examples/webgl_test_memory.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With