aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-12-01 15:00:32 +0100
committerdec05eba <dec05eba@protonmail.com>2021-12-05 19:56:54 +0100
commit1739930d6f4b16eb5f3118412cddd20277ac5639 (patch)
tree9828635730bb31fb594c306fe7f4361489a7c330 /src
parenta77da0acc88c7fb861043fd0dcb9cc6536e591f1 (diff)
Destroy window before colormap
Diffstat (limited to 'src')
-rw-r--r--src/window/window.c10
1 files 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;
}