Further fix for #34121: OSL + persistent images could crash in some cases still.

This commit is contained in:
Brecht Van Lommel
2013-02-14 16:48:43 +00:00
parent adbd84c320
commit e0ca72735d
4 changed files with 7 additions and 6 deletions

View File

@@ -128,7 +128,8 @@ void BlenderSession::reset_session(BL::BlendData b_data_, BL::Scene b_scene_)
height = b_engine.resolution_y(); height = b_engine.resolution_y();
if(scene->params.modified(scene_params) || if(scene->params.modified(scene_params) ||
session->params.modified(session_params)) session->params.modified(session_params) ||
!scene_params.persistent_data)
{ {
/* if scene or session parameters changed, it's easier to simply re-create /* if scene or session parameters changed, it's easier to simply re-create
* them rather than trying to distinguish which settings need to be updated * them rather than trying to distinguish which settings need to be updated

View File

@@ -308,9 +308,9 @@ SceneParams BlenderSync::get_scene_params(BL::Scene b_scene, bool background)
params.use_bvh_cache = (background)? RNA_boolean_get(&cscene, "use_cache"): false; params.use_bvh_cache = (background)? RNA_boolean_get(&cscene, "use_cache"): false;
if(background && params.shadingsystem != SceneParams::OSL) if(background && params.shadingsystem != SceneParams::OSL)
params.persistent_images = r.use_persistent_data(); params.persistent_data = r.use_persistent_data();
else else
params.persistent_images = false; params.persistent_data = false;
return params; return params;
} }

View File

@@ -106,7 +106,7 @@ void Scene::free_memory(bool final)
particle_system_manager->device_free(device, &dscene); particle_system_manager->device_free(device, &dscene);
curve_system_manager->device_free(device, &dscene); curve_system_manager->device_free(device, &dscene);
if(!params.persistent_images || final) if(!params.persistent_data || final)
image_manager->device_free(device, &dscene); image_manager->device_free(device, &dscene);
} }

View File

@@ -125,7 +125,7 @@ public:
bool use_bvh_cache; bool use_bvh_cache;
bool use_bvh_spatial_split; bool use_bvh_spatial_split;
bool use_qbvh; bool use_qbvh;
bool persistent_images; bool persistent_data;
SceneParams() SceneParams()
{ {
@@ -146,7 +146,7 @@ public:
&& use_bvh_cache == params.use_bvh_cache && use_bvh_cache == params.use_bvh_cache
&& use_bvh_spatial_split == params.use_bvh_spatial_split && use_bvh_spatial_split == params.use_bvh_spatial_split
&& use_qbvh == params.use_qbvh && use_qbvh == params.use_qbvh
&& persistent_images == params.persistent_images); } && persistent_data == params.persistent_data); }
}; };
/* Scene */ /* Scene */