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:
authorAntonio Vazquez <blendergit@gmail.com>2019-11-26 21:04:48 +0300
committerAntonio Vazquez <blendergit@gmail.com>2019-11-26 21:05:07 +0300
commit2bbdf586d5ff1682c7a744d1282dfd41aba78390 (patch)
tree45b2580708d7e91249601857bd1a471fdd29e659 /source/blender/editors
parent98dfb4dd1c8c64d1ead6ad166fad02ca36c35b1e (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')
-rw-r--r--source/blender/editors/sculpt_paint/paint_ops.c7
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;
}