From 45ba53324341234144ca02122bf2c0b5ef58c361 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Thu, 28 Jan 2010 16:49:40 +0800 Subject: [PATCH] egl: Correctly unbind contexts in eglReleaseThread. MakeCurrent unbinds the current context of the current API. Modify the current API to make sure all contexts are correctly unbound. --- src/egl/main/eglapi.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c index d0f9749f84f..7e77ef1f038 100644 --- a/src/egl/main/eglapi.c +++ b/src/egl/main/eglapi.c @@ -997,6 +997,7 @@ eglReleaseThread(void) /* unbind current contexts */ if (!_eglIsCurrentThreadDummy()) { _EGLThreadInfo *t = _eglGetCurrentThread(); + EGLint api_index = t->CurrentAPIIndex; EGLint i; for (i = 0; i < _EGL_API_NUM_APIS; i++) { @@ -1004,9 +1005,12 @@ eglReleaseThread(void) if (ctx) { _EGLDisplay *disp = ctx->Resource.Display; _EGLDriver *drv = disp->Driver; + t->CurrentAPIIndex = i; (void) drv->API.MakeCurrent(drv, disp, NULL, NULL, NULL); } } + + t->CurrentAPIIndex = api_index; } _eglDestroyCurrentThread(); -- 2.30.2