kaboom: detach buffer from scene before freeing pixel data
Call wlr_scene_buffer_set_buffer(NULL) before destroying the tree and freeing the pixman images to prevent the scene graph from accessing freed memory during its next render pass.
This commit is contained in:
parent
ac74064d1c
commit
c2c3bca41b
|
|
@ -48,12 +48,15 @@ static void kaboom_destroy(struct kaboom_state *state)
|
|||
{
|
||||
if (state->timer)
|
||||
wl_event_source_remove(state->timer);
|
||||
/* Detach buffer from scene before freeing pixel data */
|
||||
if (state->scene_buf)
|
||||
wlr_scene_buffer_set_buffer(state->scene_buf, NULL);
|
||||
if (state->tree)
|
||||
wlr_scene_node_destroy(&state->tree->node);
|
||||
if (state->image)
|
||||
pixman_image_unref(state->image);
|
||||
if (state->src_image)
|
||||
pixman_image_unref(state->src_image);
|
||||
if (state->image)
|
||||
pixman_image_unref(state->image);
|
||||
wlr_buffer_drop(&state->base);
|
||||
free(state->pieces);
|
||||
free(state);
|
||||
|
|
|
|||
Loading…
Reference in New Issue