diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-01-10 11:34:34 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-01-10 11:34:34 +0300 |
commit | bc02c5de497c360449e4de68b3c1432f9bd204de (patch) | |
tree | 111d0c60c82ac0221e47a31846f646aa187348dd /source/blender/blenkernel/intern/paint.c | |
parent | 3f837341c8f5652f02909d1ebbcf1743ab371847 (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/paint.c')
-rw-r--r-- | source/blender/blenkernel/intern/paint.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c index 32813ffce25..d1e9516f6d2 100644 --- a/source/blender/blenkernel/intern/paint.c +++ b/source/blender/blenkernel/intern/paint.c @@ -529,8 +529,10 @@ void BKE_paint_init(Scene *sce, ePaintMode mode, const char col[3]) short ob_mode = BKE_paint_object_mode_from_paint_mode(mode); brush = BKE_brush_first_search(G.main, ob_mode); - if (!brush) + if (!brush) { brush = BKE_brush_add(G.main, "Brush", ob_mode); + id_us_min(&brush->id); /* fake user only */ + } BKE_paint_brush_set(paint, brush); } |