aboutsummaryrefslogtreecommitdiff
path: root/examples/tablet.c
diff options
context:
space:
mode:
authorCalvin Lee <cyrus296@gmail.com>2017-08-15 07:56:47 +0200
committerCalvin Lee <cyrus296@gmail.com>2017-08-15 08:04:57 +0200
commit5cc7342606dbbd5e6932b39e6b1b5645164669bf (patch)
treef4cdef098650e5d0ac2f9ca3237f2f789db1d3fe /examples/tablet.c
parent5ca88af557178c0081fd408ae008686b79d6dd9c (diff)
Prevent alloc errors from crashing
Resolves #76
Diffstat (limited to 'examples/tablet.c')
-rw-r--r--examples/tablet.c5
1 files changed, 5 insertions, 0 deletions
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 <wlr/types/wlr_output.h>
#include <wlr/types/wlr_tablet_tool.h>
#include <wlr/types/wlr_tablet_pad.h>
+#include <wlr/util/log.h>
#include <math.h>
#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);