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/image.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/image.c')
-rw-r--r-- | source/blender/blenkernel/intern/image.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index ff305434b1b..9dabe6ba56b 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -552,8 +552,8 @@ void BKE_image_make_local(struct Image *ima) if (tex->id.lib == NULL) { if (tex->ima == ima) { tex->ima = ima_new; - ima_new->id.us++; - ima->id.us--; + id_us_plus(&ima_new->id); + id_us_min(&ima->id); } } tex = tex->id.next; @@ -563,8 +563,8 @@ void BKE_image_make_local(struct Image *ima) if (brush->id.lib == NULL) { if (brush->clone.image == ima) { brush->clone.image = ima_new; - ima_new->id.us++; - ima->id.us--; + id_us_plus(&ima_new->id); + id_us_min(&ima->id); } } brush = brush->id.next; @@ -744,7 +744,7 @@ Image *BKE_image_load_exists_ex(const char *filepath, bool *r_exists) if ((BKE_image_has_anim(ima) == false) || (ima->id.us == 0)) { - ima->id.us++; /* officially should not, it doesn't link here! */ + id_us_plus(&ima->id); /* officially should not, it doesn't link here! */ if (ima->ok == 0) ima->ok = IMA_OK; if (r_exists) |