GLX: attempt to fix glean makeCurrent test cases.
Two parts to this:
One we don't keep pointers to possibly freed memory anymore once we unbind the
drawables from the context. Brian I need to figure out what the comment
you made there, can we get a glean/piglit test so we can fix it properly?
If the new gc is the same as the oldGC, we call the unbind even though
we just bound it in that function. doh.
(cherry picked from master, commit 77506dac8e
)
This commit is contained in:
parent
ebe0796ba2
commit
c53705ed7b
|
@ -457,7 +457,7 @@ MakeContextCurrent(Display * dpy, GLXDrawable draw,
|
||||||
&dummy_reply);
|
&dummy_reply);
|
||||||
}
|
}
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#ifdef GLX_DIRECT_RENDERING
|
||||||
else if (oldGC->driContext) {
|
else if (oldGC->driContext && oldGC != gc) {
|
||||||
oldGC->driContext->unbindContext(oldGC->driContext);
|
oldGC->driContext->unbindContext(oldGC->driContext);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -119,6 +119,9 @@ static int driUnbindContext(__DRIcontext *pcp)
|
||||||
pdp = pcp->driDrawablePriv;
|
pdp = pcp->driDrawablePriv;
|
||||||
prp = pcp->driReadablePriv;
|
prp = pcp->driReadablePriv;
|
||||||
|
|
||||||
|
/* already unbound */
|
||||||
|
if (!pdp && !prp)
|
||||||
|
return GL_TRUE;
|
||||||
/* Let driver unbind drawable from context */
|
/* Let driver unbind drawable from context */
|
||||||
(*psp->DriverAPI.UnbindContext)(pcp);
|
(*psp->DriverAPI.UnbindContext)(pcp);
|
||||||
|
|
||||||
|
@ -143,9 +146,10 @@ static int driUnbindContext(__DRIcontext *pcp)
|
||||||
* window we can determine the last context bound to the window and
|
* window we can determine the last context bound to the window and
|
||||||
* use that context's lock. (BrianP, 2-Dec-2000)
|
* use that context's lock. (BrianP, 2-Dec-2000)
|
||||||
*/
|
*/
|
||||||
|
pcp->driDrawablePriv = pcp->driReadablePriv = NULL;
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
/* Unbind the drawable */
|
/* Unbind the drawable */
|
||||||
pcp->driDrawablePriv = NULL;
|
|
||||||
pdp->driContextPriv = &psp->dummyContextPriv;
|
pdp->driContextPriv = &psp->dummyContextPriv;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue