From 18a77077dede34273fcdf9b15f82cadf832e6dc6 Mon Sep 17 00:00:00 2001 From: Michal Srb Date: Fri, 29 Sep 2017 14:47:56 +0200 Subject: [PATCH] Unset pixel buffer when x0vncserver client disconnects. In XDesktop::start() we allocate pixel buffer and set it as the backend to the given VNCServer. In XDesktop::stop() we deallocate the buffer, so we must unset it from the VNCServer as well. Otherwise the VNCServer could try to access it and crash, for example in deferred update. --- unix/x0vncserver/XDesktop.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/unix/x0vncserver/XDesktop.cxx b/unix/x0vncserver/XDesktop.cxx index 4a989d3f..7123d745 100644 --- a/unix/x0vncserver/XDesktop.cxx +++ b/unix/x0vncserver/XDesktop.cxx @@ -166,7 +166,8 @@ XDesktop::XDesktop(Display* dpy_, Geometry *geometry_) } XDesktop::~XDesktop() { - stop(); + if (running) + stop(); } @@ -227,6 +228,9 @@ void XDesktop::stop() { XDamageDestroy(dpy, damage); #endif + server->setPixelBuffer(0); + server = 0; + delete pb; pb = 0; } -- 2.39.5