[Bf-blender-cvs] [6e6b79de35f] master: Fix brush user count

Campbell Barton noreply at git.blender.org
Wed Jan 10 07:42:56 CET 2018


Commit: 6e6b79de35fbe5f4cf0c79dcd854827fc0c95499
Author: Campbell Barton
Date:   Wed Jan 10 17:45:34 2018 +1100
Branches: master
https://developer.blender.org/rB6e6b79de35fbe5f4cf0c79dcd854827fc0c95499

Fix brush user count

New brushes had 2 users on adding.
Caused assert removing them after.

===================================================================

M	source/blender/blenkernel/intern/brush.c

===================================================================

diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c
index 230db6dccff..8ad9cbb2625 100644
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@ -152,7 +152,8 @@ Brush *BKE_brush_add(Main *bmain, const char *name, short ob_mode)
 {
 	Brush *brush;
 
-	brush = BKE_libblock_alloc(bmain, ID_BR, name, 0);
+	/* Use no refcount, fakeuser is added in 'BKE_brush_init' */
+	brush = BKE_libblock_alloc(bmain, ID_BR, name, LIB_ID_CREATE_NO_USER_REFCOUNT);
 
 	BKE_brush_init(brush);



More information about the Bf-blender-cvs mailing list