mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-04-14 08:22:25 -04:00
tinywl: assert on memory allocation
This commit is contained in:
parent
7cb206deb4
commit
b18aec3625
1 changed files with 4 additions and 0 deletions
|
|
@ -250,6 +250,7 @@ static void server_new_keyboard(struct tinywl_server *server,
|
|||
struct wlr_keyboard *wlr_keyboard = wlr_keyboard_from_input_device(device);
|
||||
|
||||
struct tinywl_keyboard *keyboard = calloc(1, sizeof(*keyboard));
|
||||
assert(keyboard);
|
||||
keyboard->server = server;
|
||||
keyboard->wlr_keyboard = wlr_keyboard;
|
||||
|
||||
|
|
@ -625,6 +626,7 @@ static void server_new_output(struct wl_listener *listener, void *data) {
|
|||
|
||||
/* Allocates and configures our state for this output */
|
||||
struct tinywl_output *output = calloc(1, sizeof(*output));
|
||||
assert(output);
|
||||
output->wlr_output = wlr_output;
|
||||
output->server = server;
|
||||
|
||||
|
|
@ -801,6 +803,7 @@ static void server_new_xdg_toplevel(struct wl_listener *listener, void *data) {
|
|||
|
||||
/* Allocate a tinywl_toplevel for this surface */
|
||||
struct tinywl_toplevel *toplevel = calloc(1, sizeof(*toplevel));
|
||||
assert(toplevel);
|
||||
toplevel->server = server;
|
||||
toplevel->xdg_toplevel = xdg_toplevel;
|
||||
toplevel->scene_tree =
|
||||
|
|
@ -859,6 +862,7 @@ static void server_new_xdg_popup(struct wl_listener *listener, void *data) {
|
|||
struct wlr_xdg_popup *xdg_popup = data;
|
||||
|
||||
struct tinywl_popup *popup = calloc(1, sizeof(*popup));
|
||||
assert(popup);
|
||||
popup->xdg_popup = xdg_popup;
|
||||
|
||||
/* We must add xdg popups to the scene graph so they get rendered. The
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue