Fix memory leak in backend/xrender.c
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
parent
cb12430633
commit
6226ab1228
|
@ -241,17 +241,17 @@ static void render_win(void *backend_data, session_t *ps, win *w, void *win_data
|
|||
|
||||
w->pixmap_damaged = false;
|
||||
|
||||
region_t reg_paint_local;
|
||||
pixman_region32_init(®_paint_local);
|
||||
pixman_region32_copy(®_paint_local, (region_t *)reg_paint);
|
||||
pixman_region32_translate(®_paint_local, -w->g.x, -w->g.y);
|
||||
|
||||
if (!w->invert_color && w->frame_opacity == 1 && !w->dim) {
|
||||
// No extra processing needed
|
||||
wd->rendered_pict = wd->pict;
|
||||
return;
|
||||
}
|
||||
|
||||
region_t reg_paint_local;
|
||||
pixman_region32_init(®_paint_local);
|
||||
pixman_region32_copy(®_paint_local, (region_t *)reg_paint);
|
||||
pixman_region32_translate(®_paint_local, -w->g.x, -w->g.y);
|
||||
|
||||
// We don't want to modify the content of the original window when we process
|
||||
// it, so we create a buffer.
|
||||
if (wd->buffer == XCB_NONE) {
|
||||
|
@ -325,6 +325,8 @@ static void render_win(void *backend_data, session_t *ps, win *w, void *win_data
|
|||
xcb_render_fill_rectangles(ps->c, XCB_RENDER_PICT_OP_OVER,
|
||||
wd->rendered_pict, color, 1, &rect);
|
||||
}
|
||||
|
||||
pixman_region32_fini(®_paint_local);
|
||||
}
|
||||
|
||||
static void *prepare_win(void *backend_data, session_t *ps, win *w) {
|
||||
|
|
Loading…
Reference in New Issue