LightingThread: Fixed a memory leak.