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
@@ -312,8 +312,8 @@ void ShmImage::Init(int width, int height, const XVisualInfo *vinfo) | |||
ShmImage::~ShmImage() | |||
{ | |||
// FIXME: Destroy image as described in MIT-SHM documentation. | |||
if (shminfo != NULL) { | |||
XShmDetach(dpy, shminfo); | |||
shmdt(shminfo->shmaddr); | |||
shmctl(shminfo->shmid, IPC_RMID, 0); | |||
delete shminfo; |