diff options
author | Alexander Orzechowski <orzechowski.alexander@gmail.com> | 2022-03-04 19:23:27 -0500 |
---|---|---|
committer | Kirill Primak <vyivel@eclair.cafe> | 2024-01-18 18:36:54 +0300 |
commit | dbd2fbf4301d441be4f9a04a1df6d93c81c361f6 (patch) | |
tree | ed1e1da485e28529bf28922c08b021a7bc1856ac /sway/desktop | |
parent | b4d7e84d3852ea93d2aab22f5993f84a7060b950 (diff) |
view: init function should return a success bool
Diffstat (limited to 'sway/desktop')
-rw-r--r-- | sway/desktop/xdg_shell.c | 5 | ||||
-rw-r--r-- | sway/desktop/xwayland.c | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/sway/desktop/xdg_shell.c b/sway/desktop/xdg_shell.c index 63a0835b..11c112be 100644 --- a/sway/desktop/xdg_shell.c +++ b/sway/desktop/xdg_shell.c @@ -548,7 +548,10 @@ void handle_xdg_shell_toplevel(struct wl_listener *listener, void *data) { return; } - view_init(&xdg_shell_view->view, SWAY_VIEW_XDG_SHELL, &view_impl); + if (!view_init(&xdg_shell_view->view, SWAY_VIEW_XDG_SHELL, &view_impl)) { + free(xdg_shell_view); + return; + } xdg_shell_view->view.wlr_xdg_toplevel = xdg_toplevel; xdg_shell_view->map.notify = handle_map; diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c index 2c6184fd..8f79b5e7 100644 --- a/sway/desktop/xwayland.c +++ b/sway/desktop/xwayland.c @@ -796,7 +796,10 @@ struct sway_xwayland_view *create_xwayland_view(struct wlr_xwayland_surface *xsu return NULL; } - view_init(&xwayland_view->view, SWAY_VIEW_XWAYLAND, &view_impl); + if (!view_init(&xwayland_view->view, SWAY_VIEW_XWAYLAND, &view_impl)) { + free(xwayland_view); + return NULL; + } xwayland_view->view.wlr_xwayland_surface = xsurface; wl_signal_add(&xsurface->events.destroy, &xwayland_view->destroy); |