diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-10-16 09:29:28 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-10-16 09:29:28 +0400 |
commit | 089d0ad8f9d227b3cadd56184578e163ac5589f8 (patch) | |
tree | 44ba84d1ec1946927c1dbcfb4a66bc39b07af1a7 /source/blender/blenkernel/intern/idprop.c | |
parent | f12ac5b23f27882446ea6620216d9be863183e50 (diff) |
add IDP_FreeFromGroup(), replaces IDP_RemFromGroup(), IDP_FreeProperty(), MEM_freeN().
Diffstat (limited to 'source/blender/blenkernel/intern/idprop.c')
-rw-r--r-- | source/blender/blenkernel/intern/idprop.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/idprop.c b/source/blender/blenkernel/intern/idprop.c index 6f275e4ec75..594c918b4c2 100644 --- a/source/blender/blenkernel/intern/idprop.c +++ b/source/blender/blenkernel/intern/idprop.c @@ -641,7 +641,7 @@ int IDP_InsertToGroup(IDProperty *group, IDProperty *previous, IDProperty *pnew) * IDP_FreeProperty(prop); //free all subdata * MEM_freeN(prop); //free property struct itself */ -void IDP_RemFromGroup(IDProperty *group, IDProperty *prop) +void IDP_RemoveFromGroup(IDProperty *group, IDProperty *prop) { BLI_assert(group->type == IDP_GROUP); @@ -649,6 +649,16 @@ void IDP_RemFromGroup(IDProperty *group, IDProperty *prop) BLI_remlink(&group->data.group, prop); } +/** + * Removes the property from the group and frees it. + */ +void IDP_FreeFromGroup(IDProperty *group, IDProperty *prop) +{ + IDP_RemoveFromGroup(group, prop); + IDP_FreeProperty(prop); + MEM_freeN(prop); +} + IDProperty *IDP_GetPropertyFromGroup(IDProperty *prop, const char *name) { BLI_assert(prop->type == IDP_GROUP); |