mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-04-18 06:47:31 -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 <EGL/egl.h>
|
||||
#include <EGL/eglext.h>
|
||||
#include <GLES2/gl2.h>
|
||||
|
|
@ -145,6 +146,7 @@ static void handle_new_surface(struct wl_listener *listener, void *data) {
|
|||
struct wlr_surface *wlr_surface = data;
|
||||
|
||||
struct surface *surface = calloc(1, sizeof(*surface));
|
||||
assert(surface);
|
||||
surface->wlr = wlr_surface;
|
||||
|
||||
surface->commit.notify = surface_handle_commit;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue