From 33539976eff28eeeb644b5e690ac8ec537ee49b9 Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Fri, 1 Nov 2019 19:54:55 +0000 Subject: [PATCH] Check for connection error in x_new_id --- src/x.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/x.h b/src/x.h index 49cbff72..989b5b87 100644 --- a/src/x.h +++ b/src/x.h @@ -75,6 +75,9 @@ struct xvisual_info { /// Wraps x_new_id. abort the program if x_new_id returns error static inline uint32_t x_new_id(xcb_connection_t *c) { + if (xcb_connection_has_error(c)) { + log_fatal("We had a connection error"); + } auto ret = xcb_generate_id(c); if (ret == (uint32_t)-1) { log_fatal("We seems to have run of XIDs. This is either a bug in the X "