diff options
author | Kristian Høgsberg <[email protected]> | 2010-08-27 12:40:11 -0400 |
---|---|---|
committer | Kristian Høgsberg <[email protected]> | 2010-09-08 09:20:42 -0400 |
commit | 16887d042a917fa4773e4d853f50051b54e9948c (patch) | |
tree | 6e31237b62e2d49e5544a05a64d99a95015b1d39 /src/glx/dri_common.c | |
parent | b4bb6680200b5a898583392f4c831c02f41e63f7 (diff) |
glx: Drop broken drawable garbage collection
Doesn't work for pixmaps, was looking up the GLX XID and was never thread
safe. Instead, just destroy the client side structures when the
drawable is no long current for a context.
Diffstat (limited to 'src/glx/dri_common.c')
-rw-r--r-- | src/glx/dri_common.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/glx/dri_common.c b/src/glx/dri_common.c index a7fb4c64244..5fb5255416b 100644 --- a/src/glx/dri_common.c +++ b/src/glx/dri_common.c @@ -380,4 +380,29 @@ driFetchDrawable(struct glx_context *gc, GLXDrawable glxDrawable) return pdraw; } +_X_HIDDEN void +driReleaseDrawables(struct glx_context *gc) +{ + struct glx_display *const priv = __glXInitialize(gc->psc->dpy); + __GLXDRIdrawable *pdraw; + + if (priv == NULL) + return; + + if (__glxHashLookup(priv->drawHash, + gc->currentDrawable, (void *) &pdraw) == 0) { + if (pdraw->drawable == pdraw->xDrawable) + (*pdraw->destroyDrawable)(pdraw); + __glxHashDelete(priv->drawHash, gc->currentDrawable); + } + + if (gc->currentDrawable != gc->currentReadable && + __glxHashLookup(priv->drawHash, + gc->currentReadable, (void *) &pdraw) == 0) { + if (pdraw->drawable == pdraw->xDrawable) + (*pdraw->destroyDrawable)(pdraw); + __glxHashDelete(priv->drawHash, gc->currentReadable); + } +} + #endif /* GLX_DIRECT_RENDERING */ |