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:
authorCampbell Barton <ideasman42@gmail.com>2018-01-10 11:34:34 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-01-10 11:34:34 +0300
commitbc02c5de497c360449e4de68b3c1432f9bd204de (patch)
tree111d0c60c82ac0221e47a31846f646aa187348dd /source/blender/blenkernel/intern/brush.c
parent3f837341c8f5652f02909d1ebbcf1743ab371847 (diff)
Alternate fix for brush user count
This reverts change to BKE_brush_add, callers now remove the extra user. Note this isn't very convenient for callers but is consistent with other ID types. In the future we will probably remove this and have new ID's created with zero users.
Diffstat (limited to 'source/blender/blenkernel/intern/brush.c')
-rw-r--r--source/blender/blenkernel/intern/brush.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c
index 8ad9cbb2625..0f09b741330 100644
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@ -148,12 +148,14 @@ void BKE_brush_init(Brush *brush)
BKE_brush_curve_preset(brush, CURVE_PRESET_SMOOTH);
}
+/**
+ * \note Resulting brush will have two users: one as a fake user, another is assumed to be used by the caller.
+ .*/
Brush *BKE_brush_add(Main *bmain, const char *name, short ob_mode)
{
Brush *brush;
- /* Use no refcount, fakeuser is added in 'BKE_brush_init' */
- brush = BKE_libblock_alloc(bmain, ID_BR, name, LIB_ID_CREATE_NO_USER_REFCOUNT);
+ brush = BKE_libblock_alloc(bmain, ID_BR, name, 0);
BKE_brush_init(brush);