summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Gottschling <andreasgottschling@outlook.de>2019-09-27 12:02:06 -0400
committerJuan A. Suarez Romero <jasuarez@igalia.com>2019-10-02 09:41:27 -0400
commit8118131f372e01a98ab2edb016764f5f0555cfe3 (patch)
tree04fb38ed1a2dd3379ca52807759b1a9a5d213d81
parent950d16702623efa816175ca10d2fcd2408192f16 (diff)
downloadmesa-8118131f372e01a98ab2edb016764f5f0555cfe3.tar.gz
drisw: Fix shared memory leak on drawable resize
XDestroyImage will mark the segment as to-be-destroyed, but it will persist until we detach it, and we weren't doing so. Cc: mesa-stable@lists.freedesktop.org Gitlab: https://gitlab.freedesktop.org/mesa/mesa/issues/121 Reviewed-by: Adam Jackson <ajax@redhat.com> (cherry picked from commit c5a2ccec5e9fa60bbec5e7b574877f8af4c14462)
-rw-r--r--src/glx/drisw_glx.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/glx/drisw_glx.c b/src/glx/drisw_glx.c
index f38dbbca2df..39b484b2daa 100644
--- a/src/glx/drisw_glx.c
+++ b/src/glx/drisw_glx.c
@@ -86,6 +86,8 @@ XCreateDrawable(struct drisw_drawable * pdp, int shmid, Display * dpy)
if (pdp->ximage) {
XDestroyImage(pdp->ximage);
pdp->ximage = NULL;
+ if ((pdp->shminfo.shmid > 0) && (shmid != pdp->shminfo.shmid))
+ XShmDetach(dpy, &pdp->shminfo);
}
if (!xshm_error && shmid >= 0) {