Two example files that crashed texture nodes. 
- On delete texture nodes, it should free the exec cache (because this cache
  stores the node pointer.
- On redo, nodes can exist can exist without typeinfo set. Exec (free) code
  was not checking for that. Don't ask me why this happens... tex nodes are weird.
This commit is contained in:
Ton Roosendaal
2013-02-27 14:25:39 +00:00
parent 713c9afb39
commit a8c48058f9
2 changed files with 10 additions and 2 deletions

View File

@@ -991,6 +991,12 @@ void nodeFreeNode(bNodeTree *ntree, bNode *node)
if (treetype->free_node_cache)
treetype->free_node_cache(ntree, node);
/* texture node has bad habit of keeping exec data around */
if (ntree->type == NTREE_TEXTURE && ntree->execdata) {
ntreeTexEndExecTree(ntree->execdata, 1);
ntree->execdata = NULL;
}
}
/* since it is called while free database, node->id is undefined */
@@ -1040,6 +1046,7 @@ void ntreeFreeTree_ex(bNodeTree *ntree, const short do_id_user)
break;
case NTREE_TEXTURE:
ntreeTexEndExecTree(ntree->execdata, 1);
ntree->execdata = NULL;
break;
}
}

View File

@@ -248,8 +248,9 @@ void ntree_exec_end(bNodeTreeExec *exec)
MEM_freeN(exec->stack);
for (n=0, nodeexec= exec->nodeexec; n < exec->totnodes; ++n, ++nodeexec) {
if (nodeexec->node->typeinfo->freeexecfunc)
nodeexec->node->typeinfo->freeexecfunc(nodeexec->node, nodeexec->data);
if (nodeexec->node->typeinfo)
if (nodeexec->node->typeinfo->freeexecfunc)
nodeexec->node->typeinfo->freeexecfunc(nodeexec->node, nodeexec->data);
}
if (exec->nodeexec)