fix for python refcounting leak, RNA_path_resolve_full now unsets the index if its...
authorCampbell Barton <ideasman42@gmail.com>
Fri, 24 Sep 2010 03:24:15 +0000 (03:24 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 24 Sep 2010 03:24:15 +0000 (03:24 +0000)
source/blender/makesrna/intern/rna_access.c
source/blender/python/intern/bpy_rna.c

index ae44cb1..275e0cc 100644 (file)
@@ -3027,6 +3027,7 @@ int RNA_path_resolve_full(PointerRNA *ptr, const char *path, PointerRNA *r_ptr,
                        if(nextptr.data) {
                                curptr= nextptr;
                                prop= NULL; /* now we have a PointerRNA, the prop is our parent so forget it */
+                               *index= -1;
                        }
                        else
                                return 0;
@@ -3069,6 +3070,7 @@ int RNA_path_resolve_full(PointerRNA *ptr, const char *path, PointerRNA *r_ptr,
                                if(nextptr.data) {
                                        curptr= nextptr;
                                        prop= NULL;  /* now we have a PointerRNA, the prop is our parent so forget it */
+                                       *index= -1;
                                }
                                else
                                        return 0;
index 418bece..7bb551b 100644 (file)
@@ -1140,6 +1140,8 @@ static int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, ParameterList *p
                                        Py_XDECREF(value_new); return -1;
                                }
                        }
+                       
+                       Py_XDECREF(value_new);
 
                        break;
                }