Revert "glx: Simplify glXDestroyContext"

This reverts commit 7f5adf73a0.

This seems to miss the whole point of the idExists flag, as it makes the
lifetime of that being true the same as the lifetime of the Context resource.

The previously current context tag is always given in a MakeContextCurrent
request, even if that context tag is no longer valid (for example, the context
has been deleted), so this leads to BadContextTag errors.

See fd.o bug #30089 for the makecurrenttest.c testcase, and some discussion of
previous manifestations of this bug.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
Jon TURNEY 2014-04-18 12:17:04 +01:00
parent 4b0d0df34f
commit 437b27494f

View File

@ -413,7 +413,9 @@ __glXDisp_DestroyContext(__GLXclientState * cl, GLbyte * pc)
&glxc, &err))
return err;
FreeResourceByType(req->context, __glXContextRes, FALSE);
glxc->idExists = GL_FALSE;
if (!glxc->currentClient)
FreeResourceByType(req->context, __glXContextRes, FALSE);
return Success;
}