This is either a bug or a suggestion to improve the documentation around the light.dispose() function.
My question: Is it ever ok to dispose a used light source? If so, when?
I have a playground example here with a typical use case where the user has a scene and removes a light:
It results in a WebGL-error in the console.
Maybe garbage collecting will collect it eventually if I do removeLight and then removes all my references to it, but then at least documentation should say that light.dispose() is a forbidden method! Sorry if it is there in documentation, I’ve mostly looked at the API reference.
Related posts here on the forum:
- Adding / Destroying point lights (maybe it shall be in Bugs section ?)
- Mesh.light.dispose(); WebGL warning: drawElements:
In 1 it has exactly the same issue as I do but that post focuses on the blinking and not the GL-error.
In 2 the user is satisifed with keeping the light around (they probably need it again later anyway).
But what if I really want to get rid of the light?