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:
authorCampbell Barton <ideasman42@gmail.com>2014-02-05 16:08:34 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-02-05 16:08:34 +0400
commit27d482425d20c7099d352cb3cfa018e061e688f7 (patch)
tree964a10e6fbdb2b18f62537aaa72a418f31715ef0 /source/blender/makesrna/intern/rna_access.c
parent37026b12ec1047dd5f4637ad281f108a7963af83 (diff)
Fix for RNA stringifying enum-flags freeing wrong pointer.
Diffstat (limited to 'source/blender/makesrna/intern/rna_access.c')
-rw-r--r--source/blender/makesrna/intern/rna_access.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index d3080abb007..2c216343a15 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);
}
}