summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndreas Gottschling <[email protected]>2019-09-27 12:02:06 -0400
committerAdam Jackson <[email protected]>2019-09-27 16:06:05 +0000
commitc5a2ccec5e9fa60bbec5e7b574877f8af4c14462 (patch)
tree215ff9a3ab936ad44c8b60a1071d79241addaacf /src
parent90d58286cc76c9f6652a8f8342fe568d2fc0bb15 (diff)
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: [email protected] Gitlab: https://gitlab.freedesktop.org/mesa/mesa/issues/121 Reviewed-by: Adam Jackson <[email protected]>
Diffstat (limited to 'src')
-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 45a61e654c7..3bf15322ff8 100644
--- a/src/glx/drisw_glx.c
+++ b/src/glx/drisw_glx.c
@@ -56,6 +56,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) {