backend/egl: don't call gl_deinit without a current context

Otherwise epoxy will fail with assertion error.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2024-05-23 06:38:22 +01:00
parent 8655f383fb
commit ca12415e22
No known key found for this signature in database
GPG Key ID: D3A4405BE6CC17F4
1 changed files with 1 additions and 2 deletions

View File

@ -76,10 +76,9 @@ static void egl_release_image(backend_t *base, struct gl_texture *tex) {
void egl_deinit(backend_t *base) {
struct egl_data *gd = (void *)base;
gl_deinit(&gd->gl);
// Destroy EGL context
if (gd->ctx != EGL_NO_CONTEXT) {
gl_deinit(&gd->gl);
eglMakeCurrent(gd->display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
eglDestroyContext(gd->display, gd->ctx);
gd->ctx = EGL_NO_CONTEXT;