diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-12-13 15:26:19 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-12-13 15:26:19 +0300 |
commit | c1bfd014bd8fb4af1ee51ed0e2aaecb707c46ff2 (patch) | |
tree | fe80db0b6657fd8310d7fba5cf40105e5f66344d /source | |
parent | 646575f8d91af059da8e50d1b61c7ad16dc65b2e (diff) |
* rna: memory leak fix for RNA_property_enum_value()
* rigify: generate root-most bones before children, this makes parenting to dynamically created bones work.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/makesrna/intern/rna_access.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index 7bfb6d7249f..68499ebd42c 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -946,22 +946,22 @@ void RNA_property_enum_items(bContext *C, PointerRNA *ptr, PropertyRNA *prop, En int RNA_property_enum_value(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const char *identifier, int *value) { - EnumPropertyItem *item; + EnumPropertyItem *item, *item_array; int free; - RNA_property_enum_items(C, ptr, prop, &item, NULL, &free); + RNA_property_enum_items(C, ptr, prop, &item_array, NULL, &free); - for(; item->identifier; item++) { + for(item= item_array; item->identifier; item++) { if(item->identifier[0] && strcmp(item->identifier, identifier)==0) { *value = item->value; - return 1; + break; } } if(free) - MEM_freeN(item); + MEM_freeN(item_array); - return 0; + return (item->identifier) ? 1:0; } int RNA_enum_identifier(EnumPropertyItem *item, const int value, const char **identifier) |