From 5cc7342606dbbd5e6932b39e6b1b5645164669bf Mon Sep 17 00:00:00 2001 From: Calvin Lee Date: Tue, 15 Aug 2017 07:56:47 +0200 Subject: Prevent alloc errors from crashing Resolves #76 --- examples/tablet.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'examples/tablet.c') diff --git a/examples/tablet.c b/examples/tablet.c index 0651efde..17653885 100644 --- a/examples/tablet.c +++ b/examples/tablet.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include "shared.h" #include "cat.h" @@ -153,6 +154,10 @@ int main(int argc, char *argv[]) { 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); + } compositor_run(&compositor); wlr_renderer_destroy(state.renderer); -- cgit v1.2.3