Deleting a Light

When you no longer need to use a light, you can delete it from a viewport by calling the viewport's IDirect3DViewport3::DeleteLight method. The method accepts a pointer to the IDirect3DLight interface of the light you want to remove.

The DeleteLight method only removes the light object from the list that the viewport uses when rendering a scene, it does not deallocate the light object. If you want to deallocate the light object, you must call the light object's IUnknown::Release method.