From a6422818b8498021f00629d9b3ddb549c39ed27c Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 18 Aug 2024 18:16:50 +0200 Subject: x11 cursor deinit: check if display is valid --- src/cursor.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/cursor.c') diff --git a/src/cursor.c b/src/cursor.c index 078b55d..ffa1562 100644 --- a/src/cursor.c +++ b/src/cursor.c @@ -146,8 +146,10 @@ void gsr_cursor_deinit(gsr_cursor *self) { self->texture_id = 0; } - XISelectEvents(self->display, DefaultRootWindow(self->display), NULL, 0); - XFixesSelectCursorInput(self->display, DefaultRootWindow(self->display), 0); + if(self->display) { + XISelectEvents(self->display, DefaultRootWindow(self->display), NULL, 0); + XFixesSelectCursorInput(self->display, DefaultRootWindow(self->display), 0); + } self->display = NULL; self->egl = NULL; -- cgit v1.2.3