diff options
Diffstat (limited to 'vncviewer')
-rw-r--r-- | vncviewer/X11PixelBuffer.cxx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/vncviewer/X11PixelBuffer.cxx b/vncviewer/X11PixelBuffer.cxx index f83aa5f4..a7794277 100644 --- a/vncviewer/X11PixelBuffer.cxx +++ b/vncviewer/X11PixelBuffer.cxx @@ -189,7 +189,11 @@ int X11PixelBuffer::setupShm() caughtError = false; old_handler = XSetErrorHandler(XShmAttachErrorHandler); - XShmAttach(fl_display, shminfo); + if (!XShmAttach(fl_display, shminfo)) { + XSetErrorHandler(old_handler); + goto free_shmaddr; + } + XSync(fl_display, False); XSetErrorHandler(old_handler); |