From 1739930d6f4b16eb5f3118412cddd20277ac5639 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 1 Dec 2021 15:00:32 +0100 Subject: Destroy window before colormap --- src/window/window.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/window/window.c b/src/window/window.c index 8a6edbb..64c09f2 100644 --- a/src/window/window.c +++ b/src/window/window.c @@ -379,6 +379,11 @@ void mgl_window_deinit(mgl_window *self) { mgl_context *context = mgl_get_context(); x11_context *x11_context = self->context; + if(self->window) { + XDestroyWindow(context->connection, self->window); + self->window = 0; + } + if(x11_context) { x11_context_deinit(x11_context); free(x11_context); @@ -391,11 +396,6 @@ void mgl_window_deinit(mgl_window *self) { } self->clipboard_size = 0; - if(self->window) { - XDestroyWindow(context->connection, self->window); - self->window = 0; - } - self->open = false; } -- cgit v1.2.3