aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Tournoij <martin@arp242.net>2020-06-07 15:02:54 +0800
committerMartin Tournoij <martin@arp242.net>2020-06-07 15:05:19 +0800
commit8a0f5bf29288731d67b6d9bc0af10ab8d710630a (patch)
tree1315c3f4cc680f0e97fe16684f361b09d2ca8b5f
parent0ae42717c08a85a6509214e881422c7fbe7ecc45 (diff)
downloadwterm-8a0f5bf29288731d67b6d9bc0af10ab8d710630a.zip
wterm-8a0f5bf29288731d67b6d9bc0af10ab8d710630a.tar.gz
wterm-8a0f5bf29288731d67b6d9bc0af10ab8d710630a.tar.bz2
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.
-rw-r--r--src/wterm.c2
1 files changed, 1 insertions, 1 deletions
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");