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-09 21:47:10 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2015-11-09 23:00:53 +0300
commit865796375bcfa6be4288cca4243dddcb4092f70b (patch)
tree5264d4b9b0f9d392b6e1b942e0f6fd802de1fff4 /source/blender/blenkernel/intern/linestyle.c
parentcf959a879eb5ffbdfa573c5f3a00965e69d7a976 (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/blenkernel/intern/linestyle.c')
-rw-r--r--source/blender/blenkernel/intern/linestyle.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/linestyle.c b/source/blender/blenkernel/intern/linestyle.c
index 93d2b549fee..5a1dfc04045 100644
--- a/source/blender/blenkernel/intern/linestyle.c
+++ b/source/blender/blenkernel/intern/linestyle.c
@@ -134,8 +134,10 @@ void BKE_linestyle_free(FreestyleLineStyle *linestyle)
for (a = 0; a < MAX_MTEX; a++) {
mtex = linestyle->mtex[a];
- if (mtex && mtex->tex) mtex->tex->id.us--;
- if (mtex) MEM_freeN(mtex);
+ if (mtex && mtex->tex)
+ id_us_min(&mtex->tex->id);
+ if (mtex)
+ MEM_freeN(mtex);
}
if (linestyle->nodetree) {
ntreeFreeTree(linestyle->nodetree);
@@ -384,7 +386,7 @@ LineStyleModifier *BKE_linestyle_color_modifier_copy(FreestyleLineStyle *linesty
LineStyleColorModifier_DistanceFromObject *p = (LineStyleColorModifier_DistanceFromObject *)m;
LineStyleColorModifier_DistanceFromObject *q = (LineStyleColorModifier_DistanceFromObject *)new_m;
if (p->target)
- p->target->id.us++;
+ id_us_plus(&p->target->id);
q->target = p->target;
q->color_ramp = MEM_dupallocN(p->color_ramp);
q->range_min = p->range_min;
@@ -622,7 +624,7 @@ LineStyleModifier *BKE_linestyle_alpha_modifier_copy(FreestyleLineStyle *linesty
LineStyleAlphaModifier_DistanceFromObject *p = (LineStyleAlphaModifier_DistanceFromObject *)m;
LineStyleAlphaModifier_DistanceFromObject *q = (LineStyleAlphaModifier_DistanceFromObject *)new_m;
if (p->target)
- p->target->id.us++;
+ id_us_plus(&p->target->id);
q->target = p->target;
q->curve = curvemapping_copy(p->curve);
q->flags = p->flags;
@@ -897,7 +899,7 @@ LineStyleModifier *BKE_linestyle_thickness_modifier_copy(FreestyleLineStyle *lin
LineStyleThicknessModifier_DistanceFromObject *p = (LineStyleThicknessModifier_DistanceFromObject *)m;
LineStyleThicknessModifier_DistanceFromObject *q = (LineStyleThicknessModifier_DistanceFromObject *)new_m;
if (p->target)
- p->target->id.us++;
+ id_us_plus(&p->target->id);
q->target = p->target;
q->curve = curvemapping_copy(p->curve);
q->flags = p->flags;