diff options
author | Chia-I Wu <olvaffe@gmail.com> | 2010-01-28 16:49:40 +0800 |
---|---|---|
committer | Chia-I Wu <olvaffe@gmail.com> | 2010-01-28 17:28:48 +0800 |
commit | 45ba53324341234144ca02122bf2c0b5ef58c361 (patch) | |
tree | f18c85541f14b8aa62ba24a458cfd99791961a9e | |
parent | 17330479b39409a63a06ec9e6b0f8e28b585db12 (diff) | |
download | external_mesa3d-45ba53324341234144ca02122bf2c0b5ef58c361.zip external_mesa3d-45ba53324341234144ca02122bf2c0b5ef58c361.tar.gz external_mesa3d-45ba53324341234144ca02122bf2c0b5ef58c361.tar.bz2 |
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.
-rw-r--r-- | src/egl/main/eglapi.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c index d0f9749..7e77ef1 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(); |