From 8a0f5bf29288731d67b6d9bc0af10ab8d710630a Mon Sep 17 00:00:00 2001 From: Martin Tournoij Date: Sun, 7 Jun 2020 15:02:54 +0800 Subject: Check what wld.renderer is not null It would segfault for me, turns out wld.renderer is null, not entirely sure why yet but add a check for that so it'll exit instead of segfaulting. Note that using perror() instead of just exiting gives at least *some* info as to what's going wrong: Can't create renderer: Permission denied So maybe add that to die()? But that's a larger change so didn't add that here. --- src/wterm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wterm.c b/src/wterm.c index c655722..d9ec02e 100644 --- a/src/wterm.c +++ b/src/wterm.c @@ -2953,7 +2953,7 @@ void wlinit(void) { if (!wld.ctx) die("Can't create wayland context\n"); wld.renderer = wld_create_renderer(wld.ctx); - if (!wld.ctx) + if (!wld.ctx || !wld.renderer) die("Can't create renderer\n"); if (!wl.shm) die("Display has no SHM\n"); -- cgit v1.1