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/mesh/meshtools.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/mesh/meshtools.c')
-rw-r--r-- | source/blender/editors/mesh/meshtools.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/editors/mesh/meshtools.c b/source/blender/editors/mesh/meshtools.c index 2491685161c..dee003135a2 100644 --- a/source/blender/editors/mesh/meshtools.c +++ b/source/blender/editors/mesh/meshtools.c @@ -513,11 +513,13 @@ int join_mesh_exec(bContext *C, wmOperator *op) /* old material array */ for (a = 1; a <= ob->totcol; a++) { ma = ob->mat[a - 1]; - if (ma) ma->id.us--; + if (ma) + id_us_min(&ma->id); } for (a = 1; a <= me->totcol; a++) { ma = me->mat[a - 1]; - if (ma) ma->id.us--; + if (ma) + id_us_min(&ma->id); } if (ob->mat) MEM_freeN(ob->mat); if (ob->matbits) MEM_freeN(ob->matbits); |