diff options
author | Drew DeVault <sir@cmpwn.com> | 2017-08-15 12:21:58 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-15 12:21:58 -0400 |
commit | 27c13d621df7b38d04f8ffb3012aa977d1b9bb24 (patch) | |
tree | 4cf9539672adb77ddc6ac2110a6f4458b386e9a1 /examples/compositor | |
parent | f60b53c6e3c91aefa432ce75deb89560a8e5c0d7 (diff) | |
parent | 5cc7342606dbbd5e6932b39e6b1b5645164669bf (diff) |
Merge pull request #88 from 4e554c4c/alloc_crashing
Prevent alloc errors from crashing
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 16851614..e2a3a481 100644 --- a/examples/compositor/main.c +++ b/examples/compositor/main.c @@ -73,6 +73,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); |