diff options
author | Brian Paul <[email protected]> | 2009-06-17 07:58:35 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2009-06-17 08:03:19 -0600 |
commit | c53705ed7b89e5a2586b534508182de9c72452ea (patch) | |
tree | e441f38c3aed6f1bc6c8f8fd3360a9e2191eb3d1 /src/mesa/drivers | |
parent | ebe0796ba2d314202c30a1c9291a7e725c64b16a (diff) |
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 77506dac8e81e9548a7e9680ce367175fe5747af)
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r-- | src/mesa/drivers/dri/common/dri_util.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c index e1127204718..576494940f3 100644 --- a/src/mesa/drivers/dri/common/dri_util.c +++ b/src/mesa/drivers/dri/common/dri_util.c @@ -119,6 +119,9 @@ static int driUnbindContext(__DRIcontext *pcp) pdp = pcp->driDrawablePriv; prp = pcp->driReadablePriv; + /* already unbound */ + if (!pdp && !prp) + return GL_TRUE; /* Let driver unbind drawable from context */ (*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 * use that context's lock. (BrianP, 2-Dec-2000) */ + pcp->driDrawablePriv = pcp->driReadablePriv = NULL; + #if 0 /* Unbind the drawable */ - pcp->driDrawablePriv = NULL; pdp->driContextPriv = &psp->dummyContextPriv; #endif |