From 1a7638fa94fbe9c6244d054d20efa3405153747f Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 2 Jan 2013 23:10:14 +0000 Subject: add id property clear function (matching the same python function for dicts/lists) --- source/blender/blenkernel/intern/idprop.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source/blender/blenkernel/intern/idprop.c') diff --git a/source/blender/blenkernel/intern/idprop.c b/source/blender/blenkernel/intern/idprop.c index 5dd0f08dc71..3be47668fb5 100644 --- a/source/blender/blenkernel/intern/idprop.c +++ b/source/blender/blenkernel/intern/idprop.c @@ -815,6 +815,13 @@ void IDP_FreeProperty(IDProperty *prop) } } +void IDP_ClearProperty(IDProperty *prop) +{ + IDP_FreeProperty(prop); + prop->data.pointer = NULL; + prop->len = prop->totallen = 0; +} + /* Unlinks any IDProperty<->ID linkage that might be going on. * note: currently unused.*/ void IDP_UnlinkProperty(IDProperty *prop) -- cgit v1.2.3