The MIT-SHM documentation:
https://www.x.org/releases/X11R7.7/doc/xextproto/shm.html
says to run XShmDetach() first, and then to destroy the segment.
(cherry picked from commit 585ee24d4c
)
pull/1722/head
ShmImage::~ShmImage() | ShmImage::~ShmImage() | ||||
{ | { | ||||
// FIXME: Destroy image as described in MIT-SHM documentation. | |||||
if (shminfo != NULL) { | if (shminfo != NULL) { | ||||
XShmDetach(dpy, shminfo); | |||||
shmdt(shminfo->shmaddr); | shmdt(shminfo->shmaddr); | ||||
shmctl(shminfo->shmid, IPC_RMID, 0); | shmctl(shminfo->shmid, IPC_RMID, 0); | ||||
delete shminfo; | delete shminfo; |