diff options
author | Lukas Toenne <lukas.toenne@googlemail.com> | 2012-03-01 16:07:59 +0400 |
---|---|---|
committer | Lukas Toenne <lukas.toenne@googlemail.com> | 2012-03-01 16:07:59 +0400 |
commit | 6a36b6249b8dc5bd0f60572fdbc2e42e79c14981 (patch) | |
tree | 2bac8f0abb81d8dd36d76710f8c7f0711ed5766d /source | |
parent | b671f5e0de3114c801a865af5dd27add42d2c018 (diff) |
Call the node freestorage callback _before_ actually freeing sockets, since this is also responsible for freeing possible socket storage data.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/node.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index 99edd4bac8c..ba25bee46b5 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -903,12 +903,15 @@ void nodeFreeNode(bNodeTree *ntree, bNode *node) node_unlink_attached(ntree, node); BLI_remlink(&ntree->nodes, node); - + /* since it is called while free database, node->id is undefined */ if (treetype->free_node_cache) treetype->free_node_cache(ntree, node); + if(node->typeinfo && node->typeinfo->freestoragefunc) + node->typeinfo->freestoragefunc(node); + for (sock=node->inputs.first; sock; sock = nextsock) { nextsock = sock->next; node_socket_free_default_value(sock->type, sock->default_value); @@ -922,10 +925,6 @@ void nodeFreeNode(bNodeTree *ntree, bNode *node) nodeFreePreview(node); - if(node->typeinfo && node->typeinfo->freestoragefunc) { - node->typeinfo->freestoragefunc(node); - } - MEM_freeN(node); ntree->update |= NTREE_UPDATE_NODES; |