Fix memory leaks when using the new backends
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
parent
c2f274ca8a
commit
64e08cc1e3
|
@ -461,6 +461,7 @@ static void deinit(void *backend_data, session_t *ps) {
|
|||
xcb_render_free_picture(ps->c, xd->alpha_pict[i]);
|
||||
xcb_render_free_picture(ps->c, xd->white_pixel);
|
||||
xcb_render_free_picture(ps->c, xd->black_pixel);
|
||||
free_conv(xd->shadow_kernel);
|
||||
free(xd);
|
||||
}
|
||||
|
||||
|
|
|
@ -2934,6 +2934,14 @@ session_destroy(session_t *ps) {
|
|||
deinit_render(ps);
|
||||
}
|
||||
|
||||
// Free the damage ring
|
||||
for (int i = 0; i < ps->ndamage; ++i) {
|
||||
pixman_region32_fini(&ps->damage_ring[i]);
|
||||
}
|
||||
ps->ndamage = 0;
|
||||
free(ps->damage_ring);
|
||||
ps->damage_ring = ps->damage = NULL;
|
||||
|
||||
// Flush all events
|
||||
x_sync(ps->c);
|
||||
ev_io_stop(ps->loop, &ps->xiow);
|
||||
|
|
|
@ -1211,13 +1211,6 @@ void deinit_render(session_t *ps) {
|
|||
// Free other X resources
|
||||
free_root_tile(ps);
|
||||
|
||||
// Free the damage ring
|
||||
for (int i = 0; i < ps->ndamage; ++i)
|
||||
pixman_region32_fini(&ps->damage_ring[i]);
|
||||
ps->ndamage = 0;
|
||||
free(ps->damage_ring);
|
||||
ps->damage_ring = ps->damage = NULL;
|
||||
|
||||
#ifdef CONFIG_OPENGL
|
||||
free(ps->root_tile_paint.fbcfg);
|
||||
glx_destroy(ps);
|
||||
|
|
Loading…
Reference in New Issue