From fbbd48b35e53fb156b91715dae4aab9008533565 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Wed, 29 Mar 2017 13:27:32 +0200 Subject: [PATCH] Avoid leaking shared memory via X server It's not enough that we detach from the shared memory, we must also tell the X server to do so for it to be freed properly. --- vncviewer/PlatformPixelBuffer.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/vncviewer/PlatformPixelBuffer.cxx b/vncviewer/PlatformPixelBuffer.cxx index 4802ba46..7b3f34a0 100644 --- a/vncviewer/PlatformPixelBuffer.cxx +++ b/vncviewer/PlatformPixelBuffer.cxx @@ -69,6 +69,7 @@ PlatformPixelBuffer::~PlatformPixelBuffer() #if !defined(WIN32) && !defined(__APPLE__) if (shminfo) { vlog.debug("Freeing shared memory XImage"); + XShmDetach(fl_display, shminfo); shmdt(shminfo->shmaddr); shmctl(shminfo->shmid, IPC_RMID, 0); delete shminfo; -- 2.39.5