Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Toenne <lukas.toenne@googlemail.com>2011-02-24 18:48:09 +0300
committerLukas Toenne <lukas.toenne@googlemail.com>2011-02-24 18:48:09 +0300
commit04d04f64011a06255f91faf4445947d162b5a9f0 (patch)
tree5a7865c2fa311f91d0616191e291389d95146520 /source/blender
parentd00b5736a52934d610c0fa4140ea6e9444326a56 (diff)
Fixed memory leak in group nodes. Only buffers from exposed sockets should remain after group execution.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenkernel/intern/node.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c
index 631c4e76115..7f8a27bd947 100644
--- a/source/blender/blenkernel/intern/node.c
+++ b/source/blender/blenkernel/intern/node.c
@@ -1983,6 +1983,33 @@ static void node_group_execute(bNodeStack *stack, void *data, bNode *gnode, bNod
node->typeinfo->execfunc(data, node, nsin, nsout);
}
}
+
+ /* free internal buffers */
+ if (ntree->type==NTREE_COMPOSIT) {
+ bNodeSocket *sock;
+ bNodeStack *ns;
+ for (sock=ntree->outputs.first; sock; sock=sock->next) {
+ /* use the hasoutput flag to tag external sockets */
+ if (sock->stack_type==SOCK_STACK_LOCAL) {
+ ns= get_socket_stack(stack, sock, in);
+ ns->hasoutput = 0;
+ }
+ }
+ /* now free all stacks that are not used from outside */
+ for (node=ntree->nodes.first; node; node=node->next) {
+ for (sock=node->outputs.first; sock; sock=sock->next) {
+ if (sock->stack_type==SOCK_STACK_LOCAL ) {
+ ns= get_socket_stack(stack, sock, in);
+ if (ns->hasoutput!=0 && ns->data) {
+ free_compbuf(ns->data);
+ ns->data = NULL;
+ /* reset the flag */
+ ns->hasoutput = 1;
+ }
+ }
+ }
+ }
+ }
}
static int set_stack_indexes_default(bNode *node, int index)