Commit 66877e60 authored by Simon Zeni's avatar Simon Zeni
Browse files

types/wlr_output: validate swapchain creation before destroying the current one

parent 4a8e681a
Pipeline #449222 failed with stage
in 2 minutes and 18 seconds
......@@ -261,14 +261,15 @@ static struct wlr_buffer *render_cursor_buffer(struct wlr_output_cursor *cursor)
return NULL;
}
wlr_swapchain_destroy(output->cursor_swapchain);
output->cursor_swapchain = wlr_swapchain_create(allocator,
struct wlr_swapchain *swapchain = wlr_swapchain_create(allocator,
width, height, format);
free(format);
if (output->cursor_swapchain == NULL) {
if (swapchain == NULL) {
wlr_log(WLR_ERROR, "Failed to create cursor swapchain");
return NULL;
}
wlr_swapchain_destroy(output->cursor_swapchain);
output->cursor_swapchain = swapchain;
}
struct wlr_buffer *buffer =
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment