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/editors/curve/editfont.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/editors/curve/editfont.c')
-rw-r--r-- | source/blender/editors/curve/editfont.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/editors/curve/editfont.c b/source/blender/editors/curve/editfont.c index ea6b6154be8..1eee5d04c56 100644 --- a/source/blender/editors/curve/editfont.c +++ b/source/blender/editors/curve/editfont.c @@ -51,6 +51,7 @@ #include "BKE_curve.h" #include "BKE_depsgraph.h" #include "BKE_font.h" +#include "BKE_library.h" #include "BKE_main.h" #include "BKE_object.h" #include "BKE_report.h" @@ -538,7 +539,7 @@ static void txt_add_object(bContext *C, TextLine *firstline, int totline, const cu = obedit->data; cu->vfont = BKE_vfont_builtin_get(); - cu->vfont->id.us++; + id_us_plus(&cu->vfont->id); for (tmp = firstline, a = 0; nbytes < MAXTEXT && a < totline; tmp = tmp->next, a++) { size_t nchars_line, nbytes_line; @@ -1727,7 +1728,7 @@ static int font_open_exec(bContext *C, wmOperator *op) if (pprop->prop) { /* when creating new ID blocks, use is already 1, but RNA * pointer se also increases user, so this compensates it */ - font->id.us--; + id_us_min(&font->id); RNA_id_pointer_create(&font->id, &idptr); RNA_property_pointer_set(&pprop->ptr, pprop->prop, idptr); |