From 008983004441e6594d87c5ed982a2d4e273d3a57 Mon Sep 17 00:00:00 2001 From: Antony Riakiotakis Date: Sun, 17 Mar 2013 16:53:35 +0000 Subject: [PATCH] Fix evil own bug: paint_redraw accessed freed memory. Still doesn't solve problem not being able to paint with black in image editor. --- source/blender/editors/sculpt_paint/paint_image.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index 6645015a2b2..144dfa948d0 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -529,6 +529,8 @@ static void paint_stroke_done(const bContext *C, struct PaintStroke *stroke) ToolSettings *settings = scene->toolsettings; PaintOperation *pop = paint_stroke_mode_data(stroke); + paint_redraw(C, pop, 1); + if (pop->timer) WM_event_remove_timer(CTX_wm_manager(C), CTX_wm_window(C), pop->timer); @@ -541,7 +543,6 @@ static void paint_stroke_done(const bContext *C, struct PaintStroke *stroke) paint_2d_stroke_done(pop->custom_paint); } - paint_redraw(C, pop, 1); undo_paint_push_end(UNDO_PAINT_IMAGE); /* duplicate warning, see texpaint_init