From c07424411af5a4581dc16d5aa91b167b16c7826e Mon Sep 17 00:00:00 2001 From: Alexander Orzechowski Date: Fri, 14 Oct 2022 14:30:44 -0400 Subject: [PATCH] wlr_scene: Destroy the texture when setting a new buffer. Fixes: https://github.com/labwc/labwc/issues/587 Fixes: f0e31e806f7cb88c9d55dc0eb1876c86600d28df (wlr_scene: Fix not updating the scene node when setting a new buffer) --- types/scene/wlr_scene.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/types/scene/wlr_scene.c b/types/scene/wlr_scene.c index 9c274f39..c5c301a7 100644 --- a/types/scene/wlr_scene.c +++ b/types/scene/wlr_scene.c @@ -566,6 +566,9 @@ void wlr_scene_buffer_set_buffer_with_damage(struct wlr_scene_buffer *scene_buff bool update = false; wlr_buffer_unlock(scene_buffer->buffer); + wlr_texture_destroy(scene_buffer->texture); + scene_buffer->texture = NULL; + if (buffer) { // if this node used to not be mapped or its previous displayed // buffer region will be different from what the new buffer would