Fix #32088: cycles crash removing a lamp with non-progressive sampling.
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Mon, 3 Sep 2012 16:52:59 +0000 (16:52 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Mon, 3 Sep 2012 16:52:59 +0000 (16:52 +0000)
intern/cycles/render/light.cpp

index d00b242d153bf590b42e4edbcf3f0fba655e7e81..6445c04257f9b886b5c3764fee3e4a8226ee72ae 100644 (file)
@@ -289,8 +289,14 @@ void LightManager::device_update_distribution(Device *device, DeviceScene *dscen
                /* CDF */
                device->tex_alloc("__light_distribution", dscene->light_distribution);
        }
-       else
+       else {
                dscene->light_distribution.clear();
+
+               kintegrator->num_distribution = 0;
+               kintegrator->num_all_lights = 0;
+               kintegrator->pdf_triangles = 0.0f;
+               kintegrator->pdf_lights = 0.0f;
+       }
 }
 
 void LightManager::device_update_background(Device *device, DeviceScene *dscene, Scene *scene, Progress& progress)