Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2015-11-19 20:03:38 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2015-11-19 20:03:38 +0300
commitc8bf45c3232874c720acd6aca6ebb1ad8a4af1f7 (patch)
treebe7c69423f65dbef660255a5dee139979faa77b4 /source/blender/blenkernel/intern
parent70cf77e1ce61fd7f1339163c3792feb6c9a09782 (diff)
Fix T48806: mesh.materials.clear() does not decrement users counts.
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r--source/blender/blenkernel/intern/material.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c
index ba81f68ff23..8614deddc3e 100644
--- a/source/blender/blenkernel/intern/material.c
+++ b/source/blender/blenkernel/intern/material.c
@@ -669,6 +669,10 @@ void BKE_material_clear_id(struct ID *id, bool update_data)
Material ***matar;
if ((matar = give_matarar_id(id))) {
short *totcol = give_totcolp_id(id);
+
+ while ((*totcol)--) {
+ id_us_min((ID *)((*matar)[*totcol]));
+ }
*totcol = 0;
if (*matar) {
MEM_freeN(*matar);