Zemanzo / web-marbles

Aims to recreate Marble Racing from the ground up, as a fully web based game
https://playmarbl.es/
GNU General Public License v3.0
23 stars 12 forks source link

Proper three.js object disposal #290

Open Qaomen opened 3 years ago

Qaomen commented 3 years ago

Description Three.js requires us to call .dispose() on certain objects once they are no longer used, and not doing so can cause memory leaks and performance issues. Since we're not calling .dispose() anywhere in the code at the moment, it sure wouldn't hurt resolving this issue.

Minimum Acceptance Criteria Ensure the following three.js objects are cleaned up correctly (marble skins are intentionally cached and don't require cleanup when unused):

Reference https://threejs.org/docs/index.html#manual/en/introduction/How-to-dispose-of-objects