diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2015-11-09 21:47:10 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2015-11-09 23:00:53 +0300 |
commit | 865796375bcfa6be4288cca4243dddcb4092f70b (patch) | |
tree | 5264d4b9b0f9d392b6e1b942e0f6fd802de1fff4 /source/blender/blenkernel/intern/idprop.c | |
parent | cf959a879eb5ffbdfa573c5f3a00965e69d7a976 (diff) |
Cleanup: avoid incrementing/decrementing id->us outside of BKE_library.
We have callbacks for that, they also do some checks and help ensure things are done
correctly. Only place where this is assumed not true is blenloader (since here we
may affect refcount of library IDs as well...).
Diffstat (limited to 'source/blender/blenkernel/intern/idprop.c')
-rw-r--r-- | source/blender/blenkernel/intern/idprop.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/idprop.c b/source/blender/blenkernel/intern/idprop.c index 4d83f8cf916..86d010f5f7c 100644 --- a/source/blender/blenkernel/intern/idprop.c +++ b/source/blender/blenkernel/intern/idprop.c @@ -439,14 +439,15 @@ void IDP_FreeString(IDProperty *prop) * \{ */ void IDP_LinkID(IDProperty *prop, ID *id) { - if (prop->data.pointer) ((ID *)prop->data.pointer)->us--; + if (prop->data.pointer) + id_us_min(((ID *)prop->data.pointer)); prop->data.pointer = id; id_us_plus(id); } void IDP_UnlinkID(IDProperty *prop) { - ((ID *)prop->data.pointer)->us--; + id_us_min(((ID *)prop->data.pointer)); } /** \} */ |