diff options
Diffstat (limited to 'src/mgl.c')
-rw-r--r-- | src/mgl.c | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -74,6 +74,8 @@ int mgl_init(void) { return -1; } + context.net_wm_ping_atom = XInternAtom(context.connection, "_NET_WM_PING", True); + if(mgl_gl_load(&context.gl) != 0) { mgl_deinit(); return -1; @@ -90,9 +92,6 @@ int mgl_init(void) { void mgl_deinit(void) { if(init_count == 1) { if(context.connection) { - glx_context_deinit(); - mgl_gl_unload(&context.gl); - XSetIOErrorHandler(prev_xioerror); prev_xioerror = NULL; @@ -101,6 +100,13 @@ void mgl_deinit(void) { XCloseDisplay(context.connection); context.connection = NULL; + + /* + GLX needs to be unloaded after closing the display on nvidia because + nvidia registers cleanup callbacks on exit, that uses the x11 display. + */ + glx_context_deinit(); + mgl_gl_unload(&context.gl); } } |