Browse Source

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>
tags/19.1-branchpoint
Ray Zhang 6 years ago
parent
commit
b344e32cdf
1 changed files with 3 additions and 0 deletions
  1. 3
    0
      src/glx/drisw_glx.c

+ 3
- 0
src/glx/drisw_glx.c 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);

Loading…
Cancel
Save