aboutsummaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2020-12-12 13:15:07 +0100
committerSimon Ser <contact@emersion.fr>2020-12-21 16:31:07 +0100
commit55b02f753f6bdc004ac2f7af27f89d82946b8701 (patch)
tree7d999ee748788add6fe35869a7572f449fb2abd8 /backend
parentd6dbdd97e90882569899e458f6bbc44bdc6d0a8a (diff)
backend/x11: destroy buffers when destroying output
Diffstat (limited to 'backend')
-rw-r--r--backend/x11/output.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/backend/x11/output.c b/backend/x11/output.c
index a5d834fc..eb35e584 100644
--- a/backend/x11/output.c
+++ b/backend/x11/output.c
@@ -82,6 +82,8 @@ static bool output_set_custom_mode(struct wlr_output *wlr_output,
return true;
}
+static void destroy_x11_buffer(struct wlr_x11_buffer *buffer);
+
static void output_destroy(struct wlr_output *wlr_output) {
struct wlr_x11_output *output = get_x11_output_from_output(wlr_output);
struct wlr_x11_backend *x11 = output->x11;
@@ -89,6 +91,11 @@ static void output_destroy(struct wlr_output *wlr_output) {
wlr_input_device_destroy(&output->pointer_dev);
wlr_input_device_destroy(&output->touch_dev);
+ struct wlr_x11_buffer *buffer, *buffer_tmp;
+ wl_list_for_each_safe(buffer, buffer_tmp, &output->buffers, link) {
+ destroy_x11_buffer(buffer);
+ }
+
wl_list_remove(&output->link);
wl_event_source_remove(output->frame_timer);
wlr_buffer_unlock(output->back_buffer);