[Bf-blender-cvs] [0451934] master: Properly decrease users of images when deleting a paint slot.
Antony Riakiotakis
noreply at git.blender.org
Wed Jan 28 11:09:46 CET 2015
Commit: 0451934538561594229e18b4ccb89a8e85b3a405
Author: Antony Riakiotakis
Date: Wed Jan 28 11:09:19 2015 +0100
Branches: master
https://developer.blender.org/rB0451934538561594229e18b4ccb89a8e85b3a405
Properly decrease users of images when deleting a paint slot.
===================================================================
M source/blender/editors/sculpt_paint/paint_image_proj.c
===================================================================
diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c
index 3e67501..fd1ca1b 100644
--- a/source/blender/editors/sculpt_paint/paint_image_proj.c
+++ b/source/blender/editors/sculpt_paint/paint_image_proj.c
@@ -5323,8 +5323,13 @@ static int texture_paint_delete_texture_paint_slot_exec(bContext *C, wmOperator
slot = ma->texpaintslot + ma->paint_active_slot;
- if (ma->mtex[slot->index]->tex)
+ if (ma->mtex[slot->index]->tex) {
id_us_min(&ma->mtex[slot->index]->tex->id);
+
+ if (ma->mtex[slot->index]->tex->ima) {
+ id_us_min(&ma->mtex[slot->index]->tex->ima->id);
+ }
+ }
MEM_freeN(ma->mtex[slot->index]);
ma->mtex[slot->index] = NULL;
More information about the Bf-blender-cvs
mailing list