glx: make sure the context is really destroyed

GLX context is released when it's no longer current in any threads, so
we have to release the context before destroy it.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2020-03-07 20:06:25 +00:00
parent c2938ad4d9
commit def63f9a56
No known key found for this signature in database
GPG Key ID: 37C999F617EA1A47
1 changed files with 1 additions and 0 deletions

View File

@ -198,6 +198,7 @@ void glx_deinit(backend_t *base) {
// Destroy GLX context // Destroy GLX context
if (gd->ctx) { if (gd->ctx) {
glXMakeCurrent(gd->display, None, NULL);
glXDestroyContext(gd->display, gd->ctx); glXDestroyContext(gd->display, gd->ctx);
gd->ctx = 0; gd->ctx = 0;
} }