From: Pierre Ossman Date: Mon, 7 Nov 2022 12:45:34 +0000 (+0100) Subject: Flush decoder errors on close() X-Git-Tag: v1.12.90~8 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e46d2c36d82c7e8f385ead5947446d7161b9aaf9;p=tigervnc.git Flush decoder errors on close() We don't want any stray exceptions as we are cleaning up, so handle any still pending decoder errors by just logging them. We are already shutting down so there is no need to abort the connection here. --- diff --git a/common/rfb/CConnection.cxx b/common/rfb/CConnection.cxx index 675b49d6..396b48b3 100644 --- a/common/rfb/CConnection.cxx +++ b/common/rfb/CConnection.cxx @@ -388,6 +388,16 @@ void CConnection::close() { state_ = RFBSTATE_CLOSING; + /* + * We're already shutting down, so just log any pending decoder + * problems + */ + try { + decoder.flush(); + } catch (rdr::Exception& e) { + vlog.error("%s", e.str()); + } + setFramebuffer(NULL); delete csecurity; csecurity = NULL;