flimshaw / Valiant360

An in-browser 360 degree panorama video player.
http://flimshaw.github.io/Valiant360/
MIT License
777 stars 151 forks source link

Add destroy method #23

Closed noosphere2 closed 8 years ago

noosphere2 commented 9 years ago

Add destroy method which cancels animationFrame, and does cleanup on three.js scene resources.

This is important if the user is done with Valiant360 and wishes for it to be wiped from the page. Previously, even if all dom elements are removed, request animation frame continues forever and can cause performance leak!