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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user