From 52033d13f4650b35cb833d36828707c7563920b4 Mon Sep 17 00:00:00 2001 From: Brenden Matthews Date: Mon, 19 Sep 2022 09:46:41 -0500 Subject: [PATCH] Check display before free. Should fix #1203. --- src/x11.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/x11.cc b/src/x11.cc index 5deacd52..b8cd4cbb 100644 --- a/src/x11.cc +++ b/src/x11.cc @@ -433,9 +433,11 @@ static void init_X11() { } static void deinit_X11() { - DBGP("deinit_X11()"); - XCloseDisplay(display); - display = nullptr; + if (display) { + DBGP("deinit_X11()"); + XCloseDisplay(display); + display = nullptr; + } } static void update_workarea() {