glx: fix shared memory leak in X11

call XShmDetach to allow X server to free shared memory

Fixes: bcd80be49a "drisw/glx: use XShm if possible"
Signed-off-by: Ray Zhang <zhanglei002@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
Ray Zhang
2019-02-27 06:54:05 +00:00
committed by Dave Airlie
parent e907337fad
commit b344e32cdf
+3
View File
@@ -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);