aboutsummaryrefslogtreecommitdiff
path: root/src/window
diff options
context:
space:
mode:
Diffstat (limited to 'src/window')
-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;
}