diff options
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/idprop.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/idprop.c b/source/blender/blenkernel/intern/idprop.c index dd3e34c51e7..f83f66daa85 100644 --- a/source/blender/blenkernel/intern/idprop.c +++ b/source/blender/blenkernel/intern/idprop.c @@ -220,6 +220,10 @@ IDProperty *IDP_CopyGroup(IDProperty *prop) return newp; } +/* + replaces a property with the same name in a group, or adds + it if the propery doesn't exist. +*/ void IDP_ReplaceInGroup(IDProperty *group, IDProperty *prop) { IDProperty *loop; @@ -230,8 +234,7 @@ void IDP_ReplaceInGroup(IDProperty *group, IDProperty *prop) BLI_remlink(&group->data.group, loop); IDP_FreeProperty(loop); - MEM_freeN(loop); - + MEM_freeN(loop); return; } } @@ -263,7 +266,7 @@ int IDP_InsertToGroup(IDProperty *group, IDProperty *previous, IDProperty *pnew) } group->len++; - + BLI_insertlink(&group->data.group, previous, pnew); return 1; } @@ -349,6 +352,7 @@ IDProperty *IDP_GetProperties(ID *id, int create_if_needed) if (create_if_needed) { id->properties = MEM_callocN(sizeof(IDProperty), "IDProperty"); id->properties->type = IDP_GROUP; + strcpy(id->name, "top_level_group"); } return id->properties; } @@ -424,7 +428,7 @@ IDProperty *IDP_New(int type, IDPropertyTemplate val, char *name) return prop; } -/*NOTE: this will free all child properties of list arrays and groups! +/*NOTE: this will free all child properties including list arrays and groups! Also, note that this does NOT unlink anything! Plus it doesn't free the actual IDProperty struct either.*/ void IDP_FreeProperty(IDProperty *prop) @@ -442,7 +446,8 @@ void IDP_FreeProperty(IDProperty *prop) } } -/*Unlinks any IDProperty<->ID linkage that might be going on.*/ +/*Unlinks any IDProperty<->ID linkage that might be going on. + note: currently unused.*/ void IDP_UnlinkProperty(IDProperty *prop) { switch (prop->type) { |