mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-04-17 06:46:39 -04:00
examples: assert on memory allocation
Also checks for NULL output in the `X_from_device` functions
This commit is contained in:
parent
ebef710746
commit
7cb206deb4
11 changed files with 39 additions and 1 deletions
|
|
@ -1,3 +1,4 @@
|
|||
#include <assert.h>
|
||||
#include <getopt.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
|
|
@ -154,6 +155,7 @@ static void server_handle_new_output(struct wl_listener *listener, void *data) {
|
|||
wlr_output_init_render(wlr_output, server->allocator, server->renderer);
|
||||
|
||||
struct fullscreen_output *output = calloc(1, sizeof(*output));
|
||||
assert(output);
|
||||
output->wlr_output = wlr_output;
|
||||
output->server = server;
|
||||
output->frame.notify = output_handle_frame;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue