Browse Source

Fix shared memory leak

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
Adam Halim 11 months ago
parent
commit
43d844eca4
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      unix/x0vncserver/Image.cxx

+ 1
- 1
unix/x0vncserver/Image.cxx View File

@@ -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;

Loading…
Cancel
Save