Move deallocation of damage_ring to deinit_render
Fix a memory leak when compton is reset. Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
parent
6eff9ebf8b
commit
7d10db6531
|
@ -3150,10 +3150,6 @@ session_destroy(session_t *ps) {
|
||||||
free_paint(ps, &ps->tgt_buffer);
|
free_paint(ps, &ps->tgt_buffer);
|
||||||
|
|
||||||
pixman_region32_fini(&ps->screen_reg);
|
pixman_region32_fini(&ps->screen_reg);
|
||||||
for (int i = 0; i < ps->ndamage; ++i)
|
|
||||||
pixman_region32_fini(&ps->damage_ring[i]);
|
|
||||||
ps->ndamage = 0;
|
|
||||||
ps->damage_ring = ps->damage = NULL;
|
|
||||||
free(ps->expose_rects);
|
free(ps->expose_rects);
|
||||||
|
|
||||||
free(ps->o.config_file);
|
free(ps->o.config_file);
|
||||||
|
|
|
@ -1205,6 +1205,13 @@ void deinit_render(session_t *ps) {
|
||||||
// Free other X resources
|
// Free other X resources
|
||||||
free_root_tile(ps);
|
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
|
#ifdef CONFIG_OPENGL
|
||||||
glx_destroy(ps);
|
glx_destroy(ps);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue