From 8bdbbca4858ab143661f371cc302092759e29408 Mon Sep 17 00:00:00 2001 From: Lukas Toenne Date: Tue, 29 Oct 2013 17:46:01 +0000 Subject: Fix #37192, Rendered preview causes crash when deleting a material node in shader node editor. The 'free' callback for node execution data was accessed from the node->typeinfo, but this pointer can become invalid because the render database is not immediately freed after the job finishes. To avoid access to dangling node pointers, store the function callback in the exec data itself. The node pointer must not be accessed in the free function (wasn't used before either), these functions are purely for the execution data. --- source/blender/nodes/intern/node_exec.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source/blender/nodes/intern/node_exec.h') diff --git a/source/blender/nodes/intern/node_exec.h b/source/blender/nodes/intern/node_exec.h index 7d76ef34934..4101c6c4c4d 100644 --- a/source/blender/nodes/intern/node_exec.h +++ b/source/blender/nodes/intern/node_exec.h @@ -51,6 +51,8 @@ struct bNodeStack; typedef struct bNodeExec { struct bNode *node; /* backpointer to node */ bNodeExecData data; + + NodeFreeExecFunction freeexecfunc; /* free function, stored in exec itself to avoid dangling node pointer access */ } bNodeExec; /* Execution Data for each instance of node tree execution */ -- cgit v1.2.3