Skip to content

Commit

Permalink
backend/headless: fix regression with common renderer and allocator
Browse files Browse the repository at this point in the history
Commit c82f375 ("backend/headless: use common renderer and allocator")
changed the error handling for backend allocator failure cases.

Let's fix the issue by moving the wl_signal_add() call later. This was
also done earlier in wlr_headless_backend_create_with_renderer().

Fixes: c82f375 ("backend/headless: use common renderer and allocator")
  • Loading branch information
tmlind committed Sep 6, 2021
1 parent d290b13 commit 6a6bd4a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion backend/headless/backend.c
Expand Up @@ -134,14 +134,18 @@ static bool backend_init(struct wlr_headless_backend *backend,
} else {
backend->parent_renderer = renderer;
backend->parent_renderer_destroy.notify = handle_renderer_destroy;
wl_signal_add(&renderer->events.destroy, &backend->parent_renderer_destroy);
}

if (backend_get_allocator(&backend->backend) == NULL) {
wlr_log(WLR_ERROR, "Failed to create allocator");
return false;
}

if (renderer != NULL) {
wl_signal_add(&renderer->events.destroy,
&backend->parent_renderer_destroy);
}

backend->display_destroy.notify = handle_display_destroy;
wl_display_add_destroy_listener(display, &backend->display_destroy);

Expand Down

0 comments on commit 6a6bd4a

Please sign in to comment.