summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2010-09-21 09:56:05 -0400
committerKristian Høgsberg <krh@bitplanet.net>2010-09-21 10:20:23 -0400
commit441344ba7ed2a1d162ee33ac4bac4bf645188ceb (patch)
tree7b8bc964224708f374bd58009856e1f9c0c99e19
parentbb26272beaf1d2bddffaad5341235e70abcf483b (diff)
glx: Hold on to drawables if we're just switching to another context
https://bugs.freedesktop.org/show_bug.cgi?id=30234
-rw-r--r--src/glx/dri2_glx.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c
index 8247588e76..911298b37c 100644
--- a/src/glx/dri2_glx.c
+++ b/src/glx/dri2_glx.c
@@ -118,6 +118,8 @@ dri2_destroy_context(struct glx_context *context)
struct dri2_context *pcp = (struct dri2_context *) context;
struct dri2_screen *psc = (struct dri2_screen *) context->psc;
+ driReleaseDrawables(&pcp->base);
+
if (context->xid)
glx_send_destroy_context(psc->base.dpy, context->xid);
@@ -158,7 +160,8 @@ dri2_unbind_context(struct glx_context *context, struct glx_context *new)
(*psc->core->unbindContext) (pcp->driContext);
- driReleaseDrawables(&pcp->base);
+ if (context == new)
+ driReleaseDrawables(&pcp->base);
}
static struct glx_context *