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.
This commit is contained in:
2011-10-31 17:00:59 +00:00
parent bdb279ec5b
commit 4e0d8ccf96
4 changed files with 24 additions and 4 deletions

View File

@@ -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);