== Nodes ==
authorWillian Padovani Germano <wpgermano@gmail.com>
Fri, 16 May 2008 20:57:06 +0000 (20:57 +0000)
committerWillian Padovani Germano <wpgermano@gmail.com>
Fri, 16 May 2008 20:57:06 +0000 (20:57 +0000)
- "Memoryblock free: attempt to free NULL pointer" messages related to the Material node (Add->Input->Material). Deleting it and quitting Blender would bring 2 or 3 of these warnings. Trivial fix (check if NULL) in blenkernel/intern/node.c, though Nodes devs may be interested. Found while testing to fix the following bug:

== PyNodes ==

- Bug #11715 reported by Alexanter Feterman:

http://projects.blender.org/tracker/?func=detail&atid=125&aid=11715&group_id=9

Adding a Dynamic node and setting it to a pynode script would crash Blender if no Material Node (MatNode) was present.

Thanks Alexander for reporting and Brecht for assigning it to me.

source/blender/blenkernel/intern/node.c
source/blender/python/api2_2x/Node.c

index 28c3e1c64e6f5b91a39ced6e2cce28cc6c88e1bd..4e36df35a1492022a66b1cce81ddd856241e2076 100644 (file)
@@ -1989,7 +1989,7 @@ void ntreeEndExecTree(bNodeTree *ntree)
                if(ntree->threadstack) {
                        for(a=0; a<BLENDER_MAX_THREADS; a++) {
                                for(nts=ntree->threadstack[a].first; nts; nts=nts->next)
-                                       MEM_freeN(nts->stack);
+                                       if (nts->stack) MEM_freeN(nts->stack);
                                BLI_freelistN(&ntree->threadstack[a]);
                        }
 
index 24df6de66ccf62f6f34f9256ae4375795a007e5b..92529023b7e44afeb186027dbb3489f5585cf307 100644 (file)
@@ -919,6 +919,8 @@ static int sockoutmap_set_attr(bNodeStack **stack, short type, short idx, PyObje
        int i;
        short len, wanted_len;
 
+       if (!stack || !stack[idx]) return 0; /* no MaterialNode */
+
        if (type == SOCK_VALUE) {
                val = PyNumber_Float(value);
                if (!val)