Skip to content
This repository was archived by the owner on Nov 1, 2021. It is now read-only.

Commit

Permalink
backend/x11: destroy buffers when destroying output
Browse files Browse the repository at this point in the history
  • Loading branch information
emersion committed Dec 21, 2020
1 parent d6dbdd9 commit 55b02f7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions backend/x11/output.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,20 @@ 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;

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);
Expand Down

0 comments on commit 55b02f7

Please sign in to comment.