Fix memory leak in Photon Mapping