app: in GimpBrushCore, free old paint buffer before allocating new one
In gimp_brush_core_get_paint_buffer(), when allocating a new paint buffer, clear the old buffer *before* allocating the new one, to reduce the amount of simultaneously allocated memory.
This commit is contained in:
@ -839,14 +839,14 @@ gimp_brush_core_get_paint_buffer (GimpPaintCore *paint_core,
|
||||
return paint_core->paint_buffer;
|
||||
}
|
||||
|
||||
g_clear_object (&paint_core->paint_buffer);
|
||||
|
||||
temp_buf = gimp_temp_buf_new ((x2 - x1), (y2 - y1),
|
||||
format);
|
||||
|
||||
*paint_buffer_x = x1;
|
||||
*paint_buffer_y = y1;
|
||||
|
||||
g_clear_object (&paint_core->paint_buffer);
|
||||
|
||||
paint_core->paint_buffer = gimp_temp_buf_create_buffer (temp_buf);
|
||||
|
||||
gimp_temp_buf_unref (temp_buf);
|
||||
|
Reference in New Issue
Block a user