aboutsummaryrefslogtreecommitdiff
path: root/src/mgl.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mgl.c')
-rw-r--r--src/mgl.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/mgl.c b/src/mgl.c
index 6fd26a7..5a43427 100644
--- a/src/mgl.c
+++ b/src/mgl.c
@@ -99,16 +99,6 @@ int mgl_init(void) {
void mgl_deinit(void) {
if(init_count == 1) {
- if(prev_xioerror) {
- XSetIOErrorHandler(prev_xioerror);
- prev_xioerror = NULL;
- }
-
- if(prev_xerror) {
- XSetErrorHandler(prev_xerror);
- prev_xerror = NULL;
- }
-
if(context.connection) {
XCloseDisplay(context.connection);
context.connection = NULL;
@@ -120,6 +110,16 @@ void mgl_deinit(void) {
mgl_gl_unload(&context.gl);
}
+ if(prev_xioerror) {
+ XSetIOErrorHandler(prev_xioerror);
+ prev_xioerror = NULL;
+ }
+
+ if(prev_xerror) {
+ XSetErrorHandler(prev_xerror);
+ prev_xerror = NULL;
+ }
+
context.current_window = NULL;
}