summaryrefslogtreecommitdiff
path: root/src/glx
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2010-09-13 08:39:42 -0400
committerKristian Høgsberg <krh@bitplanet.net>2010-09-13 08:42:22 -0400
commit4ebf07a426771b62123e5fcb5a8be0de24037af1 (patch)
tree81c7e764ae5a0e38e78c0688e734e3202792685c /src/glx
parent0392e48867c27f2aa445c5c9b35f4a52ecef2f2d (diff)
glx: Don't destroy DRI2 drawables for legacy glx drawables
For GLX 1.3 drawables, we can destroy the DRI2 drawable when the GLX drawable is destroyed. However, for legacy drawables, there os no good way of knowing when the application is done with it, so we just let the DRI2 drawable linger on the server. The server will destroy the DRI2 drawable when it destroys the X drawable or the client exits anyway. https://bugs.freedesktop.org/show_bug.cgi?id=30109
Diffstat (limited to 'src/glx')
-rw-r--r--src/glx/dri2_glx.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c
index e38a40ce53..8247588e76 100644
--- a/src/glx/dri2_glx.c
+++ b/src/glx/dri2_glx.c
@@ -210,7 +210,17 @@ dri2DestroyDrawable(__GLXDRIdrawable *base)
__glxHashDelete(pdp->dri2Hash, pdraw->base.xDrawable);
(*psc->core->destroyDrawable) (pdraw->driDrawable);
- DRI2DestroyDrawable(psc->base.dpy, pdraw->base.xDrawable);
+
+ /* If it's a GLX 1.3 drawables, we can destroy the DRI2 drawable
+ * now, as the application explicitly asked to destroy the GLX
+ * drawable. Otherwise, for legacy drawables, we let the DRI2
+ * drawable linger on the server, since there's no good way of
+ * knowing when the application is done with it. The server will
+ * destroy the DRI2 drawable when it destroys the X drawable or the
+ * client exits anyway. */
+ if (pdraw->base.xDrawable != pdraw->base.drawable)
+ DRI2DestroyDrawable(psc->base.dpy, pdraw->base.xDrawable);
+
Xfree(pdraw);
}