diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2019-11-26 21:04:48 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2019-11-26 21:05:07 +0300 |
commit | 2bbdf586d5ff1682c7a744d1282dfd41aba78390 (patch) | |
tree | 45b2580708d7e91249601857bd1a471fdd29e659 /source/blender/editors/sculpt_paint/paint_ops.c | |
parent | 98dfb4dd1c8c64d1ead6ad166fad02ca36c35b1e (diff) |
Gpencil: Fix unreported memory leak duplicating Brush
When the brush is duplicated, the grease pencil settings doesn't need to be recreated.
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_ops.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_ops.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c index ef907d96075..d76403521d9 100644 --- a/source/blender/editors/sculpt_paint/paint_ops.c +++ b/source/blender/editors/sculpt_paint/paint_ops.c @@ -98,7 +98,6 @@ static int brush_add_gpencil_exec(bContext *C, wmOperator *UNUSED(op)) Paint *paint = &ts->gp_paint->paint; Brush *br = BKE_paint_brush(paint); Main *bmain = CTX_data_main(C); - // ePaintMode mode = PAINT_MODE_GPENCIL; if (br) { br = BKE_brush_copy(bmain, br); @@ -106,13 +105,13 @@ static int brush_add_gpencil_exec(bContext *C, wmOperator *UNUSED(op)) else { br = BKE_brush_add(bmain, "Brush", OB_MODE_PAINT_GPENCIL); id_us_min(&br->id); /* fake user only */ + + /* Init grease pencil specific data. */ + BKE_brush_init_gpencil_settings(br); } BKE_paint_brush_set(paint, br); - /* init grease pencil specific data */ - BKE_brush_init_gpencil_settings(br); - return OPERATOR_FINISHED; } |