aboutsummaryrefslogtreecommitdiffstats
path: root/src/glx
diff options
context:
space:
mode:
authorRay Zhang <[email protected]>2019-02-27 06:54:05 +0000
committerDave Airlie <[email protected]>2019-02-28 14:23:02 +1000
commitb344e32cdf7064a1f2ff7ef37027edda6589404f (patch)
tree8ef15bb89317b8add50467521dbf805d1e8aee4d /src/glx
parente907337fad51ec2f78b202c65a3a25d6b88ffcd8 (diff)
glx: fix shared memory leak in X11
call XShmDetach to allow X server to free shared memory Fixes: bcd80be49a8260c2233d "drisw/glx: use XShm if possible" Signed-off-by: Ray Zhang <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/glx')
-rw-r--r--src/glx/drisw_glx.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/glx/drisw_glx.c b/src/glx/drisw_glx.c
index 00c7fa100ab..48c03ca42e0 100644
--- a/src/glx/drisw_glx.c
+++ b/src/glx/drisw_glx.c
@@ -147,6 +147,9 @@ XDestroyDrawable(struct drisw_drawable * pdp, Display * dpy, XID drawable)
if (pdp->ximage)
XDestroyImage(pdp->ximage);
+ if (pdp->shminfo.shmid > 0)
+ XShmDetach(dpy, &pdp->shminfo);
+
free(pdp->visinfo);
XFreeGC(dpy, pdp->gc);