Further fix for #34121: OSL + persistent images could crash in some cases still.
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Thu, 14 Feb 2013 16:48:43 +0000 (16:48 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Thu, 14 Feb 2013 16:48:43 +0000 (16:48 +0000)
intern/cycles/blender/blender_session.cpp
intern/cycles/blender/blender_sync.cpp
intern/cycles/render/scene.cpp
intern/cycles/render/scene.h

index dfea983..98a4e5b 100644 (file)
@@ -128,7 +128,8 @@ void BlenderSession::reset_session(BL::BlendData b_data_, BL::Scene b_scene_)
        height = b_engine.resolution_y();
 
        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
                 * them rather than trying to distinguish which settings need to be updated
index 87c4eff..f6ff78a 100644 (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;
 
        if(background && params.shadingsystem != SceneParams::OSL)
-               params.persistent_images = r.use_persistent_data();
+               params.persistent_data = r.use_persistent_data();
        else
-               params.persistent_images = false;
+               params.persistent_data = false;
 
        return params;
 }
index a1fcffa..7b82a91 100644 (file)
@@ -106,7 +106,7 @@ void Scene::free_memory(bool final)
                particle_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);
        }
 
index f6e1dae..fc6b538 100644 (file)
@@ -125,7 +125,7 @@ public:
        bool use_bvh_cache;
        bool use_bvh_spatial_split;
        bool use_qbvh;
-       bool persistent_images;
+       bool persistent_data;
 
        SceneParams()
        {
@@ -146,7 +146,7 @@ public:
                && use_bvh_cache == params.use_bvh_cache
                && use_bvh_spatial_split == params.use_bvh_spatial_split
                && use_qbvh == params.use_qbvh
-               && persistent_images == params.persistent_images); }
+               && persistent_data == params.persistent_data); }
 };
 
 /* Scene */