Commit 848945e5 authored by Chia-I Wu's avatar Chia-I Wu
Browse files

egl: Unbind the old context in _eglBindContext.

The last commit incorrectly moved the code under an "else".
parent bbe459b1
......@@ -378,19 +378,18 @@ _eglBindContext(_EGLContext **ctx, _EGLSurface **draw, _EGLSurface **read)
/* bind the new context */
oldCtx = _eglBindContextToThread(newCtx, t);
if (newCtx) {
if (newCtx)
_eglBindContextToSurfaces(newCtx, draw, read);
}
else {
/* unbind the old context from its binding surfaces */
if (oldCtx && oldCtx != newCtx) {
assert(!*draw && !*read);
if (oldCtx) {
*draw = oldCtx->DrawSurface;
*read = oldCtx->ReadSurface;
assert(*draw && *read);
/* unbind the old context from its surfaces */
_eglBindContextToSurfaces(NULL, draw, read);
}
*draw = oldCtx->DrawSurface;
*read = oldCtx->ReadSurface;
assert(*draw && *read);
_eglBindContextToSurfaces(NULL, draw, read);
}
*ctx = oldCtx;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment