diff options
author | Calvin Lee <cyrus296@gmail.com> | 2017-08-15 07:56:47 +0200 |
---|---|---|
committer | Calvin Lee <cyrus296@gmail.com> | 2017-08-15 08:04:57 +0200 |
commit | 5cc7342606dbbd5e6932b39e6b1b5645164669bf (patch) | |
tree | f4cdef098650e5d0ac2f9ca3237f2f789db1d3fe /examples/compositor | |
parent | 5ca88af557178c0081fd408ae008686b79d6dd9c (diff) |
Prevent alloc errors from crashing
Resolves #76
Diffstat (limited to 'examples/compositor')
-rw-r--r-- | examples/compositor/main.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/examples/compositor/main.c b/examples/compositor/main.c index 933e27c7..9b8a041c 100644 --- a/examples/compositor/main.c +++ b/examples/compositor/main.c @@ -70,6 +70,10 @@ int main() { compositor_init(&compositor); state.renderer = wlr_gles2_renderer_init(compositor.backend); + if (!state.renderer) { + wlr_log(L_ERROR, "Could not start compositor, OOM"); + exit(EXIT_FAILURE); + } wl_display_init_shm(compositor.display); wl_compositor_init(compositor.display, &state.compositor, state.renderer); wl_shell_init(compositor.display, &state.shell); |