Gallium: Fix shared memory segment leak

Commit abe6d750e5 caused shared memory
segments to be leaked. We need to mark shared memory segments for
deletion upon construction.

Fixes: abe6d750e5 xlib: fix glXDestroyContext in Gallium frontends
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9425
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24556>
(cherry picked from commit 4c11fe8ae6)
This commit is contained in:
Julian Hagemeister 2023-08-07 13:03:20 +02:00 committed by Dylan Baker
parent d212fb6009
commit 982b3d8fc8
2 changed files with 2 additions and 1 deletions

View file

@ -9784,7 +9784,7 @@
"description": "Gallium: Fix shared memory segment leak",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "abe6d750e58d371624de75f4bad365c61e0196c1",
"notes": null

View file

@ -138,6 +138,7 @@ alloc_shm(struct xlib_displaytarget *buf, unsigned size)
return NULL;
}
shmctl(shminfo->shmid, IPC_RMID, 0);
shminfo->readOnly = False;
return shminfo->shmaddr;
}