Commit: 27d482425d20c7099d352cb3cfa018e061e688f7
Author: Campbell Barton
Date:   Wed Feb 5 23:08:34 2014 +1100
https://developer.blender.org/rB27d482425d20c7099d352cb3cfa018e061e688f7

Fix for RNA stringifying enum-flags freeing wrong pointer.

===================================================================

M       source/blender/makesrna/intern/rna_access.c

===================================================================

diff --git a/source/blender/makesrna/intern/rna_access.c 
b/source/blender/makesrna/intern/rna_access.c
index d3080ab..2c21634 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -5249,13 +5249,14 @@ char *RNA_property_as_string(bContext *C, PointerRNA 
*ptr, PropertyRNA *prop, in
                        if (RNA_property_flag(prop) & PROP_ENUM_FLAG) {
                                /* represent as a python set */
                                if (val) {
-                                       EnumPropertyItem *item = NULL;
+                                       EnumPropertyItem *item_array;
                                        bool free;
 
                                        BLI_dynstr_append(dynstr, "{");
 
-                                       RNA_property_enum_items(C, ptr, prop, 
&item, NULL, &free);
-                                       if (item) {
+                                       RNA_property_enum_items(C, ptr, prop, 
&item_array, NULL, &free);
+                                       if (item_array) {
+                                               EnumPropertyItem *item = 
item_array;
                                                bool is_first = true;
                                                for (; item->identifier; 
item++) {
                                                        if (item->identifier[0] 
&& item->value & val) {
@@ -5265,7 +5266,7 @@ char *RNA_property_as_string(bContext *C, PointerRNA 
*ptr, PropertyRNA *prop, in
                                                }
 
                                                if (free) {
-                                                       MEM_freeN(item);
+                                                       MEM_freeN(item_array);
                                                }
                                        }

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to