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:
Diffstat (limited to 'source/blender/editors/render/render_shading.c')
-rw-r--r--source/blender/editors/render/render_shading.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c
index 2e07e19e366..b540b9df16f 100644
--- a/source/blender/editors/render/render_shading.c
+++ b/source/blender/editors/render/render_shading.c
@@ -481,7 +481,7 @@ static int new_material_exec(bContext *C, wmOperator *UNUSED(op))
if (prop) {
/* when creating new ID blocks, use is already 1, but RNA
* pointer use also increases user, so this compensates it */
- ma->id.us--;
+ id_us_min(&ma->id);
RNA_id_pointer_create(&ma->id, &idptr);
RNA_property_pointer_set(&ptr, prop, idptr);
@@ -530,7 +530,7 @@ static int new_texture_exec(bContext *C, wmOperator *UNUSED(op))
if (prop) {
/* when creating new ID blocks, use is already 1, but RNA
* pointer se also increases user, so this compensates it */
- tex->id.us--;
+ id_us_min(&tex->id);
if (ptr.id.data && GS(((ID *)ptr.id.data)->name) == ID_MA &&
RNA_property_pointer_get(&ptr, prop).id.data == NULL)
@@ -593,7 +593,7 @@ static int new_world_exec(bContext *C, wmOperator *UNUSED(op))
if (prop) {
/* when creating new ID blocks, use is already 1, but RNA
* pointer se also increases user, so this compensates it */
- wo->id.us--;
+ id_us_min(&wo->id);
RNA_id_pointer_create(&wo->id, &idptr);
RNA_property_pointer_set(&ptr, prop, idptr);
@@ -1039,7 +1039,7 @@ static int freestyle_linestyle_new_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
if (lineset->linestyle) {
- lineset->linestyle->id.us--;
+ id_us_min(&lineset->linestyle->id);
lineset->linestyle = BKE_linestyle_copy(bmain, lineset->linestyle);
}
else {
@@ -1826,7 +1826,7 @@ static void paste_mtex_copybuf(ID *id)
*mtex = MEM_mallocN(sizeof(MTex), "mtex copy");
}
else if ((*mtex)->tex) {
- (*mtex)->tex->id.us--;
+ id_us_min(&(*mtex)->tex->id);
}
memcpy(*mtex, &mtexcopybuf, sizeof(MTex));