Fix T41349: Muting texture nodes can cause crashes.

Problem is that setup of stack indices which refer to the same stack
entry can lead to cyclic TexDelegate node pointers, causing an infinite
loop.

Fixing this would take too much time and require recoding large parts of
the texnodes system, which is earmarked for scrapping anyway ... So for
now just disabled muting in texnodes to avoid crashes.
This commit is contained in:
Lukas Tönne 2014-08-12 12:41:26 +02:00
parent 2b1bacddec
commit 1743c81ce1
Notes: blender-bot 2023-02-14 10:15:16 +01:00
Referenced by issue #41349, M-node crash
2 changed files with 12 additions and 1 deletions

View File

@ -159,6 +159,8 @@ bNodeTreeExec *ntree_exec_begin(bNodeExecContext *context, bNodeTree *ntree, bNo
int index;
bNode **nodelist;
int totnodes, n;
/* XXX texnodes have threading issues with muting, have to disable it there ... */
bool use_muting = (ntree->type != NTREE_TEXTURE);
/* ensure all sock->link pointers and node levels are correct */
ntreeUpdateTree(G.main, ntree);
@ -182,7 +184,7 @@ bNodeTreeExec *ntree_exec_begin(bNodeExecContext *context, bNodeTree *ntree, bNo
for (sock = node->inputs.first; sock; sock = sock->next)
node_init_input_index(sock, &index);
if (node->flag & NODE_MUTED || node->type == NODE_REROUTE) {
if (use_muting && (node->flag & NODE_MUTED || node->type == NODE_REROUTE)) {
for (sock = node->outputs.first; sock; sock = sock->next)
node_init_output_index(sock, &index, &node->internal_links);
}

View File

@ -137,6 +137,10 @@ static void foreach_nodeclass(Scene *UNUSED(scene), void *calldata, bNodeClassCa
func(calldata, NODE_CLASS_LAYOUT, N_("Layout"));
}
/* XXX muting disabled in previews because of threading issues with the main execution
* it works here, but disabled for consistency
*/
#if 0
static void localize(bNodeTree *localtree, bNodeTree *UNUSED(ntree))
{
bNode *node, *node_next;
@ -151,6 +155,11 @@ static void localize(bNodeTree *localtree, bNodeTree *UNUSED(ntree))
}
}
}
#else
static void localize(bNodeTree *UNUSED(localtree), bNodeTree *UNUSED(ntree))
{
}
#endif
static void local_sync(bNodeTree *localtree, bNodeTree *ntree)
{