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:
authorThomas Beck <software@plasmasolutions.de>2013-11-24 16:54:47 +0400
committerThomas Beck <software@plasmasolutions.de>2013-11-24 16:54:47 +0400
commit1e096852bf38f8d7b9bdb93d9a5f1e585b87db05 (patch)
tree67485f8a1ceaafa6b75a12d482fb8b1e8609b204 /source/blender/editors
parent1fe114a876b1383d6cfccd07c4b55bf0b4cf57d5 (diff)
Commit D31 : Check if the user count needs to be decreased after adding a new BI image texture.
Fixes this problem: *Go to the Blender (BI) textures tab and open an existing image. *Hit on the plus sign next to datablock to create a new image. *Complete the creation process and switch back to the first (loaded) image. -> The image user count raises... will raise as often as you hit the plus sign
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/space_image/image_ops.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c
index b7d3407b826..58d835b0d2f 100644
--- a/source/blender/editors/space_image/image_ops.c
+++ b/source/blender/editors/space_image/image_ops.c
@@ -1792,7 +1792,9 @@ static int image_new_exec(bContext *C, wmOperator *op)
else {
Tex *tex = CTX_data_pointer_get_type(C, "texture", &RNA_Texture).data;
if (tex && tex->type == TEX_IMAGE) {
- tex->ima = ima;
+ if (tex->ima)
+ tex->ima->id.us--; /* Decrease the previous image users count by 1 */
+ tex->ima = ima; /* Assign the new image */
ED_area_tag_redraw(CTX_wm_area(C));
}
}