Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2011-10-31 21:00:59 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2011-10-31 21:00:59 +0400
commit4e0d8ccf9619f72fb6cbca1d18647f9dff1f0d73 (patch)
tree2bd53384c66578fdd787b674823b599f27e071ae /source/blender/nodes/shader/node_shader_tree.c
parentbdb279ec5b4f8537bc30a54bef814bd47f2aef1e (diff)
Fix #29084: material/texture nodes crash introduced in 2.60, execdata is being
lazely created but this wasn't done in a thread safe way.
Diffstat (limited to 'source/blender/nodes/shader/node_shader_tree.c')
-rw-r--r--source/blender/nodes/shader/node_shader_tree.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/source/blender/nodes/shader/node_shader_tree.c b/source/blender/nodes/shader/node_shader_tree.c
index cc8e1619570..a83b32097df 100644
--- a/source/blender/nodes/shader/node_shader_tree.c
+++ b/source/blender/nodes/shader/node_shader_tree.c
@@ -212,8 +212,15 @@ void ntreeShaderExecTree(bNodeTree *ntree, ShadeInput *shi, ShadeResult *shr)
/* each material node has own local shaderesult, with optional copying */
memset(shr, 0, sizeof(ShadeResult));
- if (!exec)
- exec = ntree->execdata = ntreeShaderBeginExecTree(ntree, 1);
+ /* ensure execdata is only initialized once */
+ if (!exec) {
+ BLI_lock_thread(LOCK_NODES);
+ if(!ntree->execdata)
+ ntree->execdata = ntreeShaderBeginExecTree(ntree, 1);
+ BLI_unlock_thread(LOCK_NODES);
+
+ exec = ntree->execdata;
+ }
nts= ntreeGetThreadStack(exec, shi->thread);
ntreeExecThreadNodes(exec, nts, &scd, shi->thread);