So I have a situation where I have a webglRenderer and a scene and I am adding and removing lights from the scene. After adding 5 lights and removing them enough times, the renderer will crash because too many lights are registered in the webglRenderer. What I want to be able to do is reset the current number of lights value in the THREE.js webglRenderer when I remove the lights from the scene, so this problem does not happen. I was wondering if anyone knew how to do this or which variable I should be looking at in the THREE.js global scope.
I should note, that I have many objects that are also being added and removed along with the lights.
-Freddie