summaryrefslogtreecommitdiff
path: root/glx
diff options
context:
space:
mode:
authorJon TURNEY <jon.turney@dronecode.org.uk>2014-04-18 12:17:04 +0100
committerJon TURNEY <jon.turney@dronecode.org.uk>2014-12-05 16:37:28 +0000
commit437b27494f127854d75e59b4e2aac264e9f913e9 (patch)
tree76398a9aad5900e78129f7a122c8d811f93aab0d /glx
parent4b0d0df34f10a88c10cb23dd50087b59f5c4fece (diff)
Revert "glx: Simplify glXDestroyContext"
This reverts commit 7f5adf73a0f9a951a6df201532b4031d38054369. 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>
Diffstat (limited to 'glx')
-rw-r--r--glx/glxcmds.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/glx/glxcmds.c b/glx/glxcmds.c
index 8d3fa9ff7..009fd9be0 100644
--- a/glx/glxcmds.c
+++ b/glx/glxcmds.c
@@ -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;
}