[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [12797] branches/pynodes/source/blender: First commit to this branch (and my first commit to svn, ugh), it fixes two "error totblock" issues.

Willian Padovani Germano wgermano at superig.com.br
Wed Dec 5 20:47:20 CET 2007


Revision: 12797
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=12797
Author:   ianwill
Date:     2007-12-05 20:47:20 +0100 (Wed, 05 Dec 2007)

Log Message:
-----------
First commit to this branch (and my first commit to svn, ugh), it fixes two "error totblock" issues.

This is ongoing work, details can be found on the wiki page:

http://wiki.blender.org/index.php/BlenderDev/PyNodes#Testing

Modified Paths:
--------------
    branches/pynodes/source/blender/blenkernel/intern/node.c
    branches/pynodes/source/blender/blenloader/intern/writefile.c

Modified: branches/pynodes/source/blender/blenkernel/intern/node.c
===================================================================
--- branches/pynodes/source/blender/blenkernel/intern/node.c	2007-12-05 16:58:52 UTC (rev 12796)
+++ branches/pynodes/source/blender/blenkernel/intern/node.c	2007-12-05 19:47:20 UTC (rev 12797)
@@ -1088,7 +1088,12 @@
 		node->typeinfo->freestoragefunc(node);
 	}
 
-	if(node->type==NODE_DYNAMIC && node->typeinfo && node->typeinfo->id) {
+	/* 4PYNODES: even if not node->typeinfo->id, we have
+	 * to MEM_freeN node->typeinfo), otherwise there's a mem leak
+	 * Note: fix the if's in this function, no need to check for
+	 * node->typeinfo more than once. */
+	/*if(node->type==NODE_DYNAMIC && node->typeinfo && node->typeinfo->id) {*/
+	if(node->type==NODE_DYNAMIC) {
 		if(node->typeinfo) {
 			/* todo: add ->us support to typeinfo */
 			MEM_freeN(node->typeinfo);

Modified: branches/pynodes/source/blender/blenloader/intern/writefile.c
===================================================================
--- branches/pynodes/source/blender/blenloader/intern/writefile.c	2007-12-05 16:58:52 UTC (rev 12796)
+++ branches/pynodes/source/blender/blenloader/intern/writefile.c	2007-12-05 19:47:20 UTC (rev 12797)
@@ -450,7 +450,7 @@
 		writestruct(wd, DATA, "bNode", 1, node);
 
 	for(node= ntree->nodes.first; node; node= node->next) {
-		if(node->storage) {
+		if(node->storage && node->type!=NODE_DYNAMIC) { /* 4PYNODES */
 			/* could be handlerized at some point, now only 1 exception still */
 			if(ntree->type==NTREE_SHADER && (node->type==SH_NODE_CURVE_VEC || node->type==SH_NODE_CURVE_RGB))
 				write_curvemapping(wd, node->storage);





More information about the Bf-blender-cvs mailing list